Commit Graph

26 Commits

Author SHA1 Message Date
Jelle Zijlstra 2d97894fa9 collections: make UserDict, UserList, and UserString concrete (#1477)
* collections: make UserDict, UserList, and UserString concrete

* add version checks

https://github.com/python/cpython/commit/573b44c18f69307d7dbc95c950aab57ef7ea303e

* remove redundant methods
2017-07-26 16:34:43 -07:00
Jelle Zijlstra be7490322b Counter: fix return value of most_common() (#1491)
https://docs.python.org/3/library/collections.html#collections.Counter.most_common
https://docs.python.org/2/library/collections.html#collections.Counter.most_common
2017-07-19 20:29:32 +03:00
Semyon Proshev 5db571a8f3 Update typing.MutableMapping.update stubs to allow keyword-only arguments (#1370) 2017-05-30 21:44:10 -07:00
Semyon Proshev f9872cafd8 Update collections and typing.NamedTuple (#1276)
* Update stubs for `collections` module in both Pythons.
* Update `typing.NamedTuple` stub to have `_source` attribute.
* Fix compatibility of `deque.index` signature with supertype `Sequence`
2017-05-27 15:01:40 -07:00
Jelle Zijlstra 72a745b2f8 remove collections.MutableString (#1356)
It does not exist (some StackOverflow question I found suggests it was removed in 2.6).
2017-05-25 19:36:08 -07:00
Jelle Zijlstra b084bcd037 review exported names in collections stubs (#1197)
Fixes #709

I looked at dir(collections) in 2.7 and 3.6 and made sure the list of names matched the stubs.
2017-04-30 09:59:37 -07:00
Sam Dunster 6582a8fb59 Add collections.abc.Collection (#1177) 2017-04-18 21:08:06 -07:00
David Euresti d43f3be914 Unify stdlib/{2,3}/typing.pyi
Also fix signature of IO.seek, IO.truncate, IO.write, and MutableMapping.update
Fixes #1016

Note: I couldn't put typing.pyi in 2and3 because of an import cycle when adding `import sys` to 2/typing.pyi
2017-03-19 09:43:40 -07:00
Ivan Levkivskyi b430318ac0 Fix non-subscriptable type aliases (#993) 2017-03-13 17:24:34 -07:00
Jelle Zijlstra e80b25d1be allow instantiating ChainMap (#929)
A previous PR led mypy to refuse to instantiate ChainMap,
because it had unimplemented abstract methods.
This PR adds the abstract methods to the stub,
which is enough to persuade mypy to allow instantiating
ChainMap.
2017-02-11 10:10:13 -08:00
Mike Patek c760a4e949 Make OrderedDict inherit from Reversible (#912)
Fixes #904
2017-02-01 09:23:43 -08:00
Jelle Zijlstra 6e84021f56 ChainMap fixes (#878)
- It didn't exist before 3.3 (https://docs.python.org/3/library/collections.html#chainmap-objects)
- It's not a subclass of dict
2017-01-29 20:29:29 -08:00
Jelle Zijlstra df9d11bf71 add AsyncGenerator to typing.pyi, collections/abc.pyi and collections/__init__.pyi (#815)
This parallels https://github.com/python/typing/pull/346
2017-01-18 13:24:28 -08:00
Luiz d17f7236a1 Add missing imports from collections.abc (#818)
Fixes #817
2017-01-09 17:13:27 -08:00
Lukasz Langa fe0e3744cc Fixing flake8 E261 errors 2016-12-19 22:09:35 -08:00
Hong Minhee 5fc1b4b948 Add missing MutableSet abstract base class (#680) 2016-11-10 14:10:10 -08:00
Hong Minhee 13b1cdc834 Stubs for collections.abc (#671)
The ABC types were moved to collections.abc in 3.3 (but still exist in collections too).
2016-11-08 21:37:33 -08:00
Roy Williams 1b30761802 Small changes by @rowilla to collections.pyi and urllib/requests.pyi.
(Extracted from PR #530.)
2016-11-08 19:40:10 -08:00
Reiner Gerecke 5624e7fd4b Add collections.Container to Python 2/3 (#608) 2016-10-15 08:16:02 -07:00
Manuel Krebber aa549db5e5 Added missing operations to collections.Counter stub. (#575) 2016-09-27 10:07:57 -07:00
Elazar e25b882041 Full signature for namedtuple (#541) 2016-09-13 16:17:26 -07:00
Tomasz Elendt 34175b888d Fix __setitem__(slice, ...) of various mutable sequences (#496)
Adds support of assigning iterables to slice of mutable sequences and
bytes to bytearray's slice.
2016-08-23 19:02:50 -07:00
speezepearson e815c803a6 add ChainMap class to collections module (#361)
* add ChainMap class to collections module

* ...and add it for Python 2 as well.
2016-07-13 06:16:37 -07:00
Alvaro Caceres d0ac66f5f8 Use "..." for attribute values, instead of None, [], {} 2016-06-15 14:10:04 -05:00
rwbarton 2b80cdf75e Use overloading rather than Union for MutableMapping.update (#174)
See https://github.com/python/mypy/issues/1430 for motivation.
2016-05-01 17:50:01 +01:00
Ben Darnell 9d2f90d2dc collections: convert from module to package
Making room for collections.abc
2016-04-11 00:27:58 -04:00