Re: [ZODB-Dev] Default comparison considered harmful in BTrees.

2010-10-28 Thread Jim Fulton
On Thu, Oct 28, 2010 at 8:27 AM, Hanno Schlichting  wrote:
> On Wed, Oct 27, 2010 at 8:56 PM, Jim Fulton  wrote:

...

>> As I said earlier, in 3.11, it will be an error to use an object with
>> default comparison as a key, but loading state with such objects will
>> only warn.

Looking at this a bit more. I decided I'll only error when updating
a BTree or set using __setitem__ or add.  So even in 3.11, you won't
get an error when loading an object or using an invalid key in a query method.
You will still get a warning,

> I agree with them being useful. And once I'm not busy at the
> conference, I'll give it more proper testing.

Thanks.  Note that to get at the version you were playing with, you'll need
to select a specific svn revision, as I reverted the relevant changes from
the 3.10 branch.  I exhausted by time budget for this and it may take a few days
before I get changes back on the 3.10 branch (and refine my changes on the
trunk).

Jim

-- 
Jim Fulton
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

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


Re: [ZODB-Dev] Default comparison considered harmful in BTrees.

2010-10-28 Thread Hanno Schlichting
On Wed, Oct 27, 2010 at 8:56 PM, Jim Fulton  wrote:
> On Wed, Oct 27, 2010 at 1:59 PM, Hanno Schlichting  wrote:
>
> I suppose that depends on the application.  Was the use of None
> intentional, or the result of sloppy coding?

I'd have to check the code. I expect it to be sloppy coding.

> I'll make a 3.10.1 release without it and a 3.10.2a1 release with it.

Thanks a lot for this!

> I do think these warnings are beneficial, possibly wildly so. :)
> As I said earlier, in 3.11, it will be an error to use an object with
> default comparison as a key, but loading state with such objects will
> only warn.

I agree with them being useful. And once I'm not busy at the
conference, I'll give it more proper testing.

Thanks,
Hanno
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

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