Skip to content

Renames ucollections -> collections #836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
:mod:`ucollections` -- collection and container types
:mod:`collections` -- collection and container types
=====================================================

.. include:: ../templates/unsupported_in_circuitpython.inc

.. module:: ucollections
.. module:: collections
:synopsis: collection and container types

|see_cpython_module| :mod:`cpython:collections`.
Expand All @@ -24,7 +24,7 @@ Classes
a string with space-separated field named (but this is less efficient).
Example of use::

from ucollections import namedtuple
from collections import namedtuple

MyTuple = namedtuple("MyTuple", ("id", "name"))
t1 = MyTuple(1, "foo")
Expand All @@ -38,7 +38,7 @@ Classes
added. When ordered dict is iterated over, keys/items are returned in
the order they were added::

from ucollections import OrderedDict
from collections import OrderedDict

# To make benefit of ordered keys, OrderedDict should be initialized
# from sequence of (key, value) pairs.
Expand Down
2 changes: 1 addition & 1 deletion docs/library/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Python standard libraries and micro-libraries
gc.rst
sys.rst
binascii.rst
ucollections.rst
collections.rst
uerrno.rst
hashlib.rst
uheapq.rst
Expand Down
2 changes: 1 addition & 1 deletion py/modcollections.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#if MICROPY_PY_COLLECTIONS

STATIC const mp_rom_map_elem_t mp_module_collections_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ucollections) },
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_collections) },
{ MP_ROM_QSTR(MP_QSTR_namedtuple), MP_ROM_PTR(&mp_namedtuple_obj) },
#if MICROPY_PY_COLLECTIONS_ORDEREDDICT
{ MP_ROM_QSTR(MP_QSTR_OrderedDict), MP_ROM_PTR(&mp_type_ordereddict) },
Expand Down
2 changes: 1 addition & 1 deletion py/objmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
{ MP_ROM_QSTR(MP_QSTR_uio), MP_ROM_PTR(&mp_module_io) },
#endif
#if MICROPY_PY_COLLECTIONS
{ MP_ROM_QSTR(MP_QSTR_ucollections), MP_ROM_PTR(&mp_module_collections) },
{ MP_ROM_QSTR(MP_QSTR_collections), MP_ROM_PTR(&mp_module_collections) },
#endif
#if MICROPY_PY_STRUCT
{ MP_ROM_QSTR(MP_QSTR_ustruct), MP_ROM_PTR(&mp_module_ustruct) },
Expand Down
7 changes: 2 additions & 5 deletions tests/basics/class_store_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
try:
from collections import namedtuple
except ImportError:
try:
from ucollections import namedtuple
except ImportError:
print("SKIP")
raise SystemExit
print("SKIP")
raise SystemExit

import skip_if
skip_if.no_cpython_compat()
Expand Down
5 changes: 1 addition & 4 deletions tests/basics/namedtuple1.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
try:
try:
from collections import namedtuple
except ImportError:
from ucollections import namedtuple
from collections import namedtuple
except ImportError:
print("SKIP")
raise SystemExit
Expand Down
5 changes: 1 addition & 4 deletions tests/basics/namedtuple1_cpython_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
skip_if.no_cpython_compat()

try:
try:
from collections import namedtuple
except ImportError:
from ucollections import namedtuple
from collections import namedtuple
except ImportError:
skip_if.skip()

Expand Down
7 changes: 2 additions & 5 deletions tests/basics/ordereddict1.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
try:
from collections import OrderedDict
except ImportError:
try:
from ucollections import OrderedDict
except ImportError:
print("SKIP")
raise SystemExit
print("SKIP")
raise SystemExit

d = OrderedDict([(10, 20), ("b", 100), (1, 2)])
print(len(d))
Expand Down
7 changes: 2 additions & 5 deletions tests/basics/ordereddict_eq.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
try:
from collections import OrderedDict
except ImportError:
try:
from ucollections import OrderedDict
except ImportError:
print("SKIP")
raise SystemExit
print("SKIP")
raise SystemExit

x = OrderedDict()
y = OrderedDict()
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/var-8-namedtuple-1st.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bench
from ucollections import namedtuple
from collections import namedtuple

T = namedtuple("Tup", ["num", "bar"])

Expand Down
2 changes: 1 addition & 1 deletion tests/bench/var-8.1-namedtuple-5th.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bench
from ucollections import namedtuple
from collections import namedtuple

T = namedtuple("Tup", ["foo1", "foo2", "foo3", "foo4", "num"])

Expand Down
5 changes: 1 addition & 4 deletions tests/skip_if.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ def __init__(self, board):

def no_cpython_compat():
try:
try:
from collections import namedtuple
except ImportError:
from ucollections import namedtuple
from collections import namedtuple
except ImportError:
skip()
try:
Expand Down