Commit Graph

16 Commits

Author SHA1 Message Date
Raymond Hettinger 7c3738e11c Example of multiple replacements. 2007-11-15 03:16:09 +00:00
Raymond Hettinger 213ae014db Fixup example in docs. 2007-11-15 02:58:20 +00:00
Raymond Hettinger 5681cbce81 Small improvement to the implementation of __replace__(). 2007-11-15 02:55:42 +00:00
Raymond Hettinger eeeb9c4445 Accept Issac Morland's suggestion for __replace__ to allow multiple replacements
(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.
2007-11-15 02:44:53 +00:00
Raymond Hettinger abfd8dff3b More docs, error messages, and tests 2007-10-16 21:28:32 +00:00
Raymond Hettinger 68995867d5 Accept Jim Jewett's api suggestion to use None instead of -1 to indicate unbounded deques. 2007-10-10 00:26:46 +00:00
Raymond Hettinger a48a29947a Eliminate camelcase function name 2007-10-08 21:26:58 +00:00
Raymond Hettinger b6893f2bf8 Missed a line in the docs 2007-10-08 09:56:29 +00:00
Raymond Hettinger 2115bbc4da Add comments to NamedTuple code.
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).
2007-10-08 09:14:28 +00:00
Raymond Hettinger a7fc4b13e0 Add __asdict__() to NamedTuple and refine the docs.
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.
2007-10-05 02:47:07 +00:00
Raymond Hettinger 7268e9d1ff Fit nits 2007-09-20 03:03:43 +00:00
Raymond Hettinger cbab5949c9 Cleanup docs for NamedTuple. 2007-09-18 22:18:02 +00:00
Raymond Hettinger 2b03d45bb9 Handle corner cased on 0-tuples and 1-tuples. Add verbose option so people can see how it works. 2007-09-18 03:33:19 +00:00
Raymond Hettinger d36a60e1e3 Sync-up named tuples with the latest version of the ASPN recipe.
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.
2007-09-17 00:55:00 +00:00
Mark Summerfield 7f626f4c34 Added more cross-references. 2007-08-30 15:03:03 +00:00
Georg Brandl 8ec7f65613 Move the 2.6 reST doc tree in place. 2007-08-15 14:28:01 +00:00