[Zope-dev] Re: [Zope-Coders] Re: Question about procedures
martin f krafft
madduck at madduck.net
Tue Mar 29 07:39:17 EST 2005
[moved from -coders to -dev]
First off: I will go with Lennart's suggestion of branches;
I fundamentally agree; I have just never worked on a project where
branches for such petty things aren't overkill. I guess Zope is
a number of magnitudes larger. :)
Now sorry for the noise on zope-coders when this should have been on
zope-dev in the first place.
Now for some of the things that Florent pointed out:
also sprach Florent Guillaume <fg at nuxeo.com> [2005.03.24.1814 +0100]:
> > - if RESPONSE is not None:
> > + if RESPONSE is not None and ob:
>
> You should check 'and ob is not None' too.
... but ob is false when it is None, no?
> But why could it be None ? What's the point (sorry I don't have
> context).
Well, I was trying to guard against errors made in other parts of
the code. I know I should not do this. It made things a lot easier
while I was preparing some other patches. Anyway, good thing
I haven't committed. :)
> > + if not hasattr(ob, 'absolute_url'):
>
> Do not use hasattr for persistent objects. Use
> if getattr(ob, 'absolute_url', None) is None:
Can I read up on the rationale somewhere?
> > + raise TypeError('constructInstance did not return a CMF object.')
>
> Also, check your indentation (should be 4 chars).
Woops.
> > - return ob.getId()
> > + return getattr(ob, 'id', None)
>
> Please don't do that, getId() is the proper API to call.
Another instance of "what to do when ob does not have an getId
method".. you are right, this is wrong.
also sprach Andreas Jung <lists at andreas-jung.com> [2005.03.25.0945 +0100]:
> For changes which are limited to a file or a subtree I do always
> prefer a patch instead of a branch.
I can create a branch and submit patches to you (this is when I wish
zope.org would be using GNU arch). Anyway, since it's probably best
for me not to make changes in the code at present time (being young
in the project and without an assigned field of responsibility),
where do I send potential patches? This list?
--
martin; (greetings from the heart of the sun.)
\____ echo mailto: !#^."<*>"|tr "<*> mailto:" net at madduck
invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver!
spamtraps: madduck.bogus at madduck.net
"next the statesmen will invent cheap lies, putting the blame upon the
nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and
refuse to examine any refutations of them; and thus he will by and by
convince himself that the war is just, and will thank god for the
better sleep he enjoys after this process of grotesque
self-deception."
-- mark twain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20050329/deb3d108/attachment.bin
More information about the Zope-Dev
mailing list