Re: [Zope3-dev] possible bug in catalog code

2005-07-08 Thread Tim Peters
[Dieter Maurer] Restrictions are fine when they are either * enforced (I know BTrees do not enforce the no mixed key types restriction) * clearly documented I do not know whether the ZODB 3.4 BTrees interfaces document the restriction (this would be a good place, I think)

[Zope3-dev] possible bug in catalog code

2005-07-07 Thread Martijn Faassen
Hi there, in zope.app.catalog.attribute, there's the following functionality: def index_doc(self, docid, object): if self.interface is not None: object = self.interface(object, None) if object is None: return None value =

Re: [Zope3-dev] possible bug in catalog code

2005-07-07 Thread Jim Fulton
Martijn Faassen wrote: Hi there, in zope.app.catalog.attribute, there's the following functionality: def index_doc(self, docid, object): if self.interface is not None: object = self.interface(object, None) if object is None: return None

Re: [Zope3-dev] possible bug in catalog code

2005-07-07 Thread Jim Fulton
Martijn Faassen wrote: Jim Fulton wrote: [snip] It would only be safe to use None as a BTree key if all of the keys used were None, which wouldn't be very interesting. :) It'd also make sense if you didn't do a range query, right? I.e. you're just looking for (None, None). I realize though

Re: [Zope3-dev] possible bug in catalog code

2005-07-07 Thread Dieter Maurer
Jim Fulton wrote at 2005-7-7 06:55 -0400: ... [Martijn] The following sequence I think leads to trouble: value = getattr(object, self.field_name, None) if value is None: return None as this means attributes that do exist and have the value None would never