[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)
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 =
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
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
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