ZCatalog regression: indexing None values

yuppie <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Hi!


Indexes shipped with ZCatalog 3 no longer work with None values:

https://github.com/zopefoundation/Products.ZCatalog/commit/c378cdab2fb8997af1a17261458a1528e7131243

I'm not sure if the old behavior did follow a well defined policy, I
just found this explanation:

http://stackoverflow.com/a/11224076

I think in general the policy was to ignore None values if the index
can't handle them. And AFAICS that's a much better policy than raising
errors as ZCatalog 3 does.

There is nothing wrong about None values returned by content attributes.
Often they have a special meaning like not initialized, not selected,
not specified. In most cases it wouldn't cause trouble if None is not
indexed, but it causes trouble if indexing raises errors.

Adjusting code that implements special behavior for None, adjusting
persistent attributes that contain None or adding wrappers that modify
indexed attributes is a lot of work.

I propose to ignore None values instead of raising errors.


Cheers,

	Yuppie
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.