Skip to content

Commit

Permalink
Issue python#19218: Rename collections.abc to _collections_abc in ord…
Browse files Browse the repository at this point in the history
…er to speed up interpreter start
  • Loading branch information
tiran committed Oct 13, 2013
1 parent ad9c9bb commit f1dc3ee
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Doc/library/collections.abc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import itertools
__name__ = '<doctest>'

**Source code:** :source:`Lib/collections/abc.py`
**Source code:** :source:`Lib/_collections_abc.py`

--------------

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions Lib/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

# For backwards compatibility, continue to make the collections ABCs
# available through the collections module.
from collections.abc import *
import collections.abc
__all__ += collections.abc.__all__
from _collections_abc import *
import _collections_abc
__all__ += _collections_abc.__all__

from _collections import deque, defaultdict
from operator import itemgetter as _itemgetter, eq as _eq
Expand Down
2 changes: 1 addition & 1 deletion Lib/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ def get_exec_path(env=None):


# Change environ to automatically call putenv(), unsetenv if they exist.
from collections.abc import MutableMapping
from _collections_abc import MutableMapping

class _Environ(MutableMapping):
def __init__(self, data, encodekey, decodekey, encodevalue, decodevalue, putenv, unsetenv):
Expand Down
2 changes: 1 addition & 1 deletion Lib/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin
from os import urandom as _urandom
from collections.abc import Set as _Set, Sequence as _Sequence
from _collections_abc import Set as _Set, Sequence as _Sequence
from hashlib import sha512 as _sha512

__all__ = ["Random","seed","random","uniform","randint","choice","sample",
Expand Down
5 changes: 5 additions & 0 deletions Lib/test/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ def test_startup_imports(self):
self.assertNotIn('locale', modules, stderr)
# http://bugs.python.org/issue19209
self.assertNotIn('copyreg', modules, stderr)
# http://bugs.python.org/issue19218>
collection_mods = {'_collections', 'collections', 'functools',
'heapq', 'itertools', 'keyword', 'operator',
'reprlib', 'types', 'weakref'}
self.assertFalse(modules.intersection(re_mods), stderr)


if __name__ == "__main__":
Expand Down
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Core and Builtins
Library
-------

- Issue #19218: Rename collections.abc to _collections_abc in order to
speed up interpreter start.

- Issue #18582: Add 'pbkdf2_hmac' to the hashlib module. It implements PKCS#5
password-based key derivation functions with HMAC as pseudorandom function.

Expand Down

0 comments on commit f1dc3ee

Please sign in to comment.