Commit Graph

49 Commits

Author SHA1 Message Date
Brett Cannon 0a140668fa Issue #18200: Update the stdlib (except tests) to use
ModuleNotFoundError.
2013-06-13 20:57:26 -04:00
Serhiy Storchaka 3ee6dabf5b Issue #17900: Allowed pickling of recursive OrderedDicts. Decreased pickled
size and pickling time.
2013-05-21 12:47:57 +03:00
Raymond Hettinger 163e9821b4 Undo the deprecation of _asdict().
Backed out changeset c4ca39bece9d
2013-05-18 00:05:20 -07:00
Raymond Hettinger 4e0172fd9a Deprecate nametuple._asdict() 2013-05-17 17:14:27 -07:00
Raymond Hettinger 8c03d832b3 merge 2013-05-17 16:43:58 -07:00
Raymond Hettinger 587d3bf78a Update docstring for _asdict() to indicate it is obsolete.
Use the cleaner looking @property style for __dict__.
Move _replace() to be just after make() to indicate that
it is a core method on named tuples.
2013-05-17 16:43:14 -07:00
Raymond Hettinger 5c71079d06 merge 2013-05-17 02:29:27 -07:00
Raymond Hettinger b37706f306 Remove unnecessary exception handler. 2013-05-17 02:28:33 -07:00
Richard Oudkerk 7a3dae056d Issue #15528: Add weakref.finalize to support finalization using
weakref callbacks.

This is 2e446e87ac5b except that collections/__init__.py has been
modified to import proxy from _weakref instead of weakref.  This
eliminates an import cycle which seems to cause a problem on Unix but
not Windows.
2013-05-05 23:05:00 +01:00
Raymond Hettinger 4072875dcb merge 2013-05-03 02:41:02 -07:00
Raymond Hettinger b98dcc1f53 Issue #15535: Fix pickling of named tuples. 2013-05-03 02:24:15 -07:00
Raymond Hettinger 325dc887ca Backport improved dict comparison logic 2013-03-23 06:34:19 -07:00
Raymond Hettinger a35e281200 Merge 2013-03-01 23:51:26 -08:00
Raymond Hettinger 4f4ba16677 Issue #17331: Use isidentifier() instead of isalnum() to check for valid identifiers. 2013-03-01 23:43:48 -08:00
Vinay Sajip 1ba81ee19a Closes #16613: Added optional mapping argument to ChainMap.new_child. 2013-01-11 23:39:53 +00:00
Raymond Hettinger 527507d72e Improve OrderedDict equality test. 2012-12-07 10:18:22 -08:00
Raymond Hettinger 1c2018c311 Small cleanup and optimization 2012-06-09 22:51:39 -07:00
Raymond Hettinger 80ed4d4774 Minor reformatting (wrap fat lines, etc.) and create an __main__ file 2012-06-09 18:46:45 -07:00
Raymond Hettinger 4fd3f0c850 Merge 2012-01-26 00:15:07 -08:00
Raymond Hettinger f1182cd4db Merge 2011-11-05 13:39:57 -07:00
Raymond Hettinger becd56822a Issue #13121: Support in-place math operators for collections.Counter(). 2011-10-19 13:40:37 -07:00
Ezio Melotti d8b509b192 #13012: use splitlines(keepends=True/False) instead of splitlines(0/1). 2011-09-28 17:37:55 +03:00
Benjamin Peterson c92f6226d7 add ChainMap to __all__ (closes #12959)
Thanks July Tikhonov.
2011-09-11 12:55:34 -04:00
Raymond Hettinger fcb393c018 Add support for unary plus and unary minus to collections.Counter() 2011-08-09 13:00:40 -07:00
Raymond Hettinger 22cc1183a3 merge 2011-06-02 23:49:44 -07:00
Raymond Hettinger 1c7b7f7fbe Userlist.copy() wasn't returning a UserList. 2011-05-05 14:34:35 -07:00
Raymond Hettinger a82aa55b5e Minor clean-ups to docstrings, comments, and var names. 2011-04-24 14:34:26 -07:00
Raymond Hettinger 4f438b7b00 Minor text rearrangement. 2011-04-20 13:09:46 -07:00
Raymond Hettinger f48ac3001a Issue #11875: Alter the previous fix to work better with subclasses 2011-04-19 17:19:11 -07:00
Raymond Hettinger 98c850a398 Issue 11875: Keep OrderedDict's __reduce__ from temporarily mutating the object. 2011-04-19 11:04:44 -07:00
Raymond Hettinger 90375bc7c0 Rework multiset methods to use less memory and to make fewer calls to __hash__. 2011-04-17 19:49:29 -07:00
Raymond Hettinger b5a40d4d3f Fix minor subclassing issue with collections.Counter 2011-04-15 13:23:01 -07:00
Raymond Hettinger f6d3e8eaef Add tests for _source to importable and exec'able.
Move __name__ back out of the template; the responsibility
for setting __name__ lies with the caller (which knows
something about the new namespace), not with the class
definition (which doesn't know about the namespace it is
being built in).
2011-03-23 20:33:30 -07:00
Raymond Hettinger 15d0c1d073 Minor clean-ups. 2011-03-23 14:38:39 -07:00
Raymond Hettinger 2ebea41d31 Expose the namedtuple source with a _source attribute. 2011-03-23 12:52:23 -07:00
Raymond Hettinger 843a751369 Move namespace setup inside the template. 2011-03-23 11:49:56 -07:00
Raymond Hettinger b2d0945c87 Minor named tuple clean-ups. 2011-03-22 22:36:21 -07:00
Raymond Hettinger fef854602b Factor-out named tuple class definition template strings. 2011-03-22 21:14:41 -07:00
Raymond Hettinger 74b015e243 Clean-up whitespace. 2011-03-22 14:22:52 -07:00
Raymond Hettinger 3e82ae0aae Replace **locals() with explicit field names. 2011-03-22 14:21:38 -07:00
Raymond Hettinger 9a3f4cbfc3 Simplify the named tuple template by using the new string format syntax. 2011-03-22 14:07:23 -07:00
Raymond Hettinger 50105d3840 Improve readability by replacing '\n' in template with real newlines. 2011-03-22 13:34:03 -07:00
Ezio Melotti 373089239b #11515: Merge with 3.2. 2011-03-15 06:03:08 +02:00
Raymond Hettinger d032131dcb Add __bool__ method. Add tests. Fix-up broken test. 2011-02-26 06:53:58 +00:00
Raymond Hettinger 9fe1ccfb5a Issue #11297: Add collections.ChainMap() 2011-02-26 01:02:51 +00:00
Eli Bendersky cbbaa96036 Issue #10516: adding list.clear() and list.copy() methods 2011-02-25 05:47:53 +00:00
Raymond Hettinger 499e19340e Add tests for the _ChainMap helper class. 2011-02-23 07:56:53 +00:00
Raymond Hettinger c9423109f5 Factor-out common code for helper classes. 2011-02-22 01:55:36 +00:00
Raymond Hettinger 158c9c26fc Issue #11085: Moved collections abstract base classes into a separate module
called collections.abc, following the pattern used by importlib.abc.  For
backwards compatibility, the names continue to also be imported into the
collections module.
2011-02-22 00:41:50 +00:00