Improve Python tree-shaking

This commit is contained in:
Justine Tunney 2021-09-06 19:24:10 -07:00
parent 5bb2275788
commit 4f41f2184d
169 changed files with 4182 additions and 2411 deletions

View file

@ -15,13 +15,21 @@ list, set, and tuple.
'''
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString', 'Counter', 'OrderedDict', 'ChainMap']
'UserString', 'Counter', 'OrderedDict', 'ChainMap',
'Awaitable', 'Coroutine',
'AsyncIterable', 'AsyncIterator', 'AsyncGenerator',
'Hashable', 'Iterable', 'Iterator', 'Generator', 'Reversible',
'Sized', 'Container', 'Callable', 'Collection',
'Set', 'MutableSet',
'Mapping', 'MutableMapping',
'MappingView', 'KeysView', 'ItemsView', 'ValuesView',
'Sequence', 'MutableSequence',
'ByteString']
# For backwards compatibility, continue to make the collections ABCs
# available through the collections module.
from _collections_abc import *
from _collections_abc import ABCMeta, AsyncGenerator, AsyncIterable, AsyncIterator, Awaitable, ByteString, Callable, Collection, Container, Coroutine, Generator, Hashable, ItemsView, Iterable, Iterator, KeysView, Mapping, MappingView, MutableMapping, MutableSequence, MutableSet, Reversible, Sequence, Set, Sized, ValuesView, _check_methods, abstractmethod, async_generator, bytearray_iterator, bytes_iterator, coroutine, dict_itemiterator, dict_items, dict_keyiterator, dict_keys, dict_valueiterator, dict_values, generator, list_iterator, list_reverseiterator, longrange_iterator, mappingproxy, range_iterator, set_iterator, str_iterator, sys, tuple_iterator, zip_iterator
import _collections_abc
__all__ += _collections_abc.__all__
from operator import itemgetter as _itemgetter, eq as _eq
from keyword import iskeyword as _iskeyword

View file

@ -1,2 +1,27 @@
from _collections_abc import *
from _collections_abc import __all__
from _collections_abc import (
Awaitable,
Coroutine,
AsyncIterable,
AsyncIterator,
AsyncGenerator,
Hashable,
Iterable,
Iterator,
Generator,
Reversible,
Sized,
Container,
Callable,
Collection,
Set,
MutableSet,
Mapping,
MutableMapping,
MappingView,
KeysView,
ItemsView,
ValuesView,
Sequence,
MutableSequence,
ByteString,
)