[Zope-dev] Re: [Zope-Coders] Re: Question about procedures

Chris Withers chris at simplistix.co.uk
Wed Mar 30 08:13:08 EST 2005


martin f krafft wrote:
>>Do not use hasattr for persistent objects. Use
>>               if getattr(ob, 'absolute_url', None) is None:
> 
> Can I read up on the rationale somewhere?

hasattr catches all exceptions and returns false.
Now google for COnflictError ;-)

>>>+              raise TypeError('constructInstance did not return a CMF object.')
>>
>>Also, check your indentation (should be 4 chars).
> 
> Woops.

You should probably run the unit tests before you commit anything.
That also means you should write tests to excercise the changes you're 
making, and make sure the tests fail BEFORE you try and fix anything.

>>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?

Patches should go in collector entries.

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list