In article <[EMAIL PROTECTED]> you write:
> Hm, I'd rather not raise exceptions.
> getUserById was introduced in Zope 2.2 and since then has never raised 
> anything. From what I can see it is used as a kind of alias for 
> getUser, expected to return None if the user does not exist.
> So, my intention is to make 'default' work, not to make it raise. I see 
> that raising may seem like a more consistent idea (think dict.get) but 
> it may also break existing code [1].

Well dict.get is the exception in the python world. Everything else that
has an optional default value raises an exception if no result is
available and the default value is not provided.

> My secret agenda is to unify the behavior of getUserById across user 
> folders. As it is now, LDAPUserFolder, GRUF, etc all implement their 
> own little variations because the default is so "strange".

Indeed, these methods lacks clear interfaces.

FWIW CPSUserFolder is at:


Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   [EMAIL PROTECTED]
Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to