lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

Inconsistency in ListField.Proxy between __contains__ and count #91

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed in ra5674b91e1. Thanks for the test case!

Original comment by djc.ochtman on 10 Dec 2009 at 3:58