The __contains__ and count methods of ListField.Proxy can return inconsistent
results.
>>> from couchdb import schema
>>> from decimal import Decimal
>>> class Thing(schema.Document):
... numbers = schema.ListField(schema.DecimalField)
...
>>> thing = Thing(numbers=[Decimal('1.0')])
>>> isinstance(thing.numbers, schema.ListField.Proxy)
True
>>> '1.0' in thing.numbers
False
>>> thing.numbers.count('1.0')
1
Small test case is attached.
Original issue reported on code.google.com by melk...@gmail.com on 28 Sep 2009 at 3:47
Original issue reported on code.google.com by
melk...@gmail.com
on 28 Sep 2009 at 3:47Attachments: