Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #24991
| Date | 2012-07-06 23:26 +0100 |
|---|---|
| From | MRAB <python@mrabarnett.plus.com> |
| Subject | Re: API design question for dbf.py |
| References | <4FF759CA.9060803@stoneleaf.us> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1876.1341613574.4697.python-list@python.org> (permalink) |
On 06/07/2012 22:34, Ethan Furman wrote: > I'm looking for some free advice. ;) > > My dbf module has three basic containers, all of which support list-like > access: Table, List, and Index, each of which is filled with _DbfRecords. > > The fun part is that a _DbfRecord can compare equal to another > _DbfRecord, a _DbfRecordTemplate, a tuple with the same values in the > same locations, or a dict with the same keys/fields and values. > > The really fun part is __contains__: should the __contains__ method > return True when a _DbfRecordTemplate, tuple, or dict is looked up in > the Table, List, or Index and there is a matching record? > Well, if x is in c and x == y, then y is in c. Does that help? ;-)
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: API design question for dbf.py MRAB <python@mrabarnett.plus.com> - 2012-07-06 23:26 +0100
csiph-web