summaryrefslogtreecommitdiffstats
path: root/Lib/collections.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue 5021: doctest.testfile should set __name__Raymond Hettinger2009-01-271-1/+1
|
* Update comments and add an optimized path for Counter.update().Raymond Hettinger2009-01-221-3/+5
|
* Simplify explanation of multiset operations by removing restrictions on ↵Raymond Hettinger2009-01-211-2/+2
| | | | negative inputs.
* Make merging easier by formattng comment blocks the same in Py3.1Raymond Hettinger2009-01-201-3/+5
|
* Add Counter() to __all__.Raymond Hettinger2009-01-201-1/+1
|
* Build-outs for Counter() class:Raymond Hettinger2009-01-201-8/+91
| | | | | | * Constructor and update() support keyword args (like their dict counterparts). * The 'del' statement no longer raises KeyError for missing values. * Add multiset operations: __add__, __sub__, __and__, __or__.
* Speed-up __repr__. Eliminate duplicate tests. Use a from-irmport.Raymond Hettinger2009-01-131-48/+3
|
* Fixup and simplify docstrings and doctests.Raymond Hettinger2009-01-131-16/+14
|
* Simplify Counter() API. Replace items keyword argumentRaymond Hettinger2009-01-131-22/+26
| | | | | | | with a mapping. Makes Counter() idempotent, makes update() API the same as Counter.__init__(), makes a more readable repr, makes the API more dict-like, and allows Steven Bethard's update() example to work.
* Issue 1696199: Add collections.Counter().Raymond Hettinger2009-01-121-0/+201
|
* Fix namedtuple bug reported by Glenn Linderman. Template did not form ↵Raymond Hettinger2008-09-251-1/+1
| | | | correctly if the field names were input in Unicode.
* Issue3065: Fixed pickling of named tuples. Added tests.Raymond Hettinger2008-06-091-1/+3
|
* Issue 2903: Add __name__ in globals for namedtuple namespace.Raymond Hettinger2008-05-301-2/+3
|
* Neaten-up the named tuple docsRaymond Hettinger2008-01-101-1/+1
|
* Clarify how to add a field to a named tuple.Raymond Hettinger2008-01-101-0/+3
|
* Examples for named tuple subclassing should include __slots__Raymond Hettinger2008-01-101-1/+3
|
* Expand comment.Raymond Hettinger2008-01-081-1/+2
|
* Use get() instead of pop() for the optimized version of _replace().Raymond Hettinger2008-01-071-1/+1
|
* Cleanup named tuple subclassing example.Raymond Hettinger2008-01-071-3/+4
|
* Add another named tuple subclassing example.Raymond Hettinger2008-01-071-0/+8
|
* Cleanup subclassing example to more clearly show fixed-width print format.Raymond Hettinger2008-01-071-2/+1
|
* Add subclassing example to docs for named tuples.Raymond Hettinger2008-01-071-2/+9
|
* Speed-up named tuple's _make() constructor.Raymond Hettinger2008-01-061-2/+2
|
* Small code simplification. Forgot that classmethods can be called from ↵Raymond Hettinger2008-01-061-1/+1
| | | | intances.
* Add error-checking to namedtuple's _replace() method.Raymond Hettinger2008-01-051-1/+4
|
* Improve namedtuple's _cast() method with a docstring, new name, and ↵Raymond Hettinger2008-01-051-2/+9
| | | | error-checking.
* 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.