summaryrefslogtreecommitdiffstats
path: root/Lib/collections.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Minor fix-ups to named tuples:Raymond Hettinger2008-01-041-4/+2
| | | | | | | | | * Make the _replace() method respect subclassing. * Using property() to make _fields read-only wasn't a good idea. It caused len(Point._fields) to fail. * Add note to _cast() about length checking and alternative with the star-operator.
* Users demand iterable input for named tuples. The author capitulates.Raymond Hettinger2007-12-181-1/+2
|
* Simplify and speedup _asdict() for named tuples.Raymond Hettinger2007-12-181-5/+5
|
* Add more namedtuple() test cases. Neaten the code and comments.Raymond Hettinger2007-12-181-10/+11
|
* Faster and simpler _replace() methodRaymond Hettinger2007-12-141-1/+1
|
* Add line spacing for readabilityRaymond Hettinger2007-12-141-8/+8
|
* Cleaner method naming conventionRaymond Hettinger2007-12-141-7/+7
|
* Small speedupRaymond Hettinger2007-12-131-1/+2
|
* Simplify implementation of __replace__()Raymond Hettinger2007-12-131-1/+1
|
* Error checking was too aggressive (reported by Chris Tismer)Raymond Hettinger2007-12-051-2/+2
|
* Backport of _abccoll.py by Benjamin Arangueren, issue 1383.Guido van Rossum2007-11-221-0/+6
| | | | With some changes of my own thrown in (e.g. backport of r58107).
* Small improvement to the implementation of __replace__().Raymond Hettinger2007-11-151-1/+1
|
* Accept Issac Morland's suggestion for __replace__ to allow multiple replacementsRaymond Hettinger2007-11-151-4/+8
| | | | | | (suprisingly, this simplifies the signature, improves clarity, and is comparably fast). Update the docs to reflect a previous change to the function name. Add an example to the docs showing how to override the default __repr__ method.
* Make __fields__ read-only. Suggested by Issac MorlandRaymond Hettinger2007-11-141-1/+1
|
* Shorter name for namedtuple()Raymond Hettinger2007-10-231-5/+5
|
* More docs, error messages, and testsRaymond Hettinger2007-10-161-0/+3
|
* Improve error messagesRaymond Hettinger2007-10-161-6/+7
|
* Make the error messages more specificRaymond Hettinger2007-10-091-6/+9
|
* Eliminate camelcase function nameRaymond Hettinger2007-10-081-5/+9
|
* Better variable namesRaymond Hettinger2007-10-081-4/+4
|
* Add comments to NamedTuple code.Raymond Hettinger2007-10-081-3/+18
| | | | | Let the field spec be either a string or a non-string sequence (suggested by Martin Blais with use cases). Improve the error message in the case of a SyntaxError (caused by a duplicate field name).
* Add __asdict__() to NamedTuple and refine the docs.Raymond Hettinger2007-10-051-5/+10
| | | | | | Add maxlen support to deque() and fixup docs. Partially fix __reduce__(). The None as a third arg was no longer supported. Still needs work on __reduce__() to handle recursive inputs.
* Handle corner cased on 0-tuples and 1-tuples. Add verbose option so people ↵Raymond Hettinger2007-09-181-8/+9
| | | | can see how it works.
* Sync-up named tuples with the latest version of the ASPN recipe.Raymond Hettinger2007-09-171-10/+19
| | | | | | | Allows optional commas in the field-name spec (help when named tuples are used in conjuction with sql queries). Adds the __fields__ attribute for introspection and to support conversion to dictionary form. Adds a __replace__() method similar to str.replace() but using a named field as a target. Clean-up spelling and presentation in doc-strings.
* Allow all alphanumeric and underscores in type and field names.Raymond Hettinger2007-05-211-1/+1
|
* Replace assertion with straight error-checking.Raymond Hettinger2007-05-211-1/+2
|
* Fix beginner mistake -- don't mix spaces and tabs.Raymond Hettinger2007-05-191-1/+1
|
* Improvements to NamedTuple's implementation, tests, and documentationRaymond Hettinger2007-05-191-24/+23
|
* Add collections.NamedTupleRaymond Hettinger2007-03-011-1/+60
|
* Prepare collections module for pure python code entries.Raymond Hettinger2007-02-281-0/+3