-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Florent Guillaume wrote:
> Julien Anguenot wrote:
> 
>> +    def beforeCommitHookOrdered(hook, order, *args, **kws):
>> +        """Register a hook to call before the transaction is committed.
> 
> ...
> 
>> +        Note, a hook __call__() method can't define any 'order'
>> argument since
>> +        this one is reserved by this method
>>  
> 
> 
> If that's a concern, maybe it can be called order__ or something ?
> What's the pythonic way to do this ?
> 

Zope3 seems to use one (1) underscore as a suffix like in :

See for instance this :
http://svn.zope.org/Zope3/trunk/src/zope/app/component/metaconfigure.py?rev=37586&view=auto

"""
def subscriber(_context, for_=None, factory=None, handler=None,
provides=None, permission=None, trusted=False, locate=False):
"""

But here, the problem is, as well, the method's signature and backward
compatibility for the beforeCommitHook() method since the only way to do
it would be to extract the "order_" from the **kws and then remove it
before storing the hook info in the data structure which doesn't provide
really a nice implementation in my opinion...

        J.

- --
Julien Anguenot | Nuxeo R&D (Paris, France)
CPS Platform : http://www.cps-project.org
Zope3 / ECM   : http://www.z3lab.org
mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFC941mGhoG8MxZ/pIRAtN9AJ9Y5zIRwNCwUTWcz0CtUaDhk2bFzgCghd/a
lROl74eHwKhkN81ExuLRFmQ=
=3dD+
-----END PGP SIGNATURE-----
_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to