Rhys Parry and Guido van Rossum
6b82088e20
Add UserDict attribute data for Python 3 ( #1863 )
2018-02-09 07:55:58 -08:00
Chad Dombrova and Ivan Levkivskyi
ed9d08e93b
Collections that inherit from dict should should override copy() ( #1856 )
...
Solves issue #1642 . A previous attempt at this, #1656 ,
added __copy__ but omitted copy, and it did not properly use self-type.
2018-02-09 00:26:37 +00:00
FichteFoll and Jelle Zijlstra
f933b9384c
Refine str.maketrans and str.translate ( #1613 )
...
str.translate requires a Mapping or Sequence (in essence, anything
with __getitem__), not a Dict.
str.maketrans in the one-argument form only converts character string
keys to their unicode ordinal, leaving any of the values untouched.
This mapping may use both integers or strings as keys at the same time.
str.maketrans in the multi-argument form returns a dict with any of the
values str, int or None, as recognized by str.translate.
2017-11-07 18:55:05 -08:00
Martin DeMello and Matthias Kramm
817c270c32
Clean out the pytype blacklist ( #1667 )
2017-10-24 10:38:34 -07:00
Suren Nihalani and Jelle Zijlstra
898299969c
typeshed: declare that ordereddict's copy returns ordereddict ( #1656 )
2017-10-08 21:15:11 -07:00
Jelle Zijlstra and Matthias Kramm
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 and Łukasz Langa
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 and Jelle Zijlstra
5db571a8f3
Update typing.MutableMapping.update stubs to allow keyword-only arguments ( #1370 )
2017-05-30 21:44:10 -07:00
Semyon Proshev and Jelle Zijlstra
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 and Matthias Kramm
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 and Guido van Rossum
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 and Jelle Zijlstra
6582a8fb59
Add collections.abc.Collection ( #1177 )
2017-04-18 21:08:06 -07:00
David Euresti and Łukasz Langa
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 and Guido van Rossum
b430318ac0
Fix non-subscriptable type aliases ( #993 )
2017-03-13 17:24:34 -07:00
Jelle Zijlstra and Guido van Rossum
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 and Guido van Rossum
c760a4e949
Make OrderedDict inherit from Reversible ( #912 )
...
Fixes #904
2017-02-01 09:23:43 -08:00
Jelle Zijlstra and Guido van Rossum
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 and Guido van Rossum
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 and Guido van Rossum
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 and Guido van Rossum
5fc1b4b948
Add missing MutableSet abstract base class ( #680 )
2016-11-10 14:10:10 -08:00
Hong Minhee and Guido van Rossum
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 and Guido van Rossum
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 and Guido van Rossum
5624e7fd4b
Add collections.Container to Python 2/3 ( #608 )
2016-10-15 08:16:02 -07:00
Manuel Krebber and Guido van Rossum
aa549db5e5
Added missing operations to collections.Counter stub. ( #575 )
2016-09-27 10:07:57 -07:00
Elazar and Guido van Rossum
e25b882041
Full signature for namedtuple ( #541 )
2016-09-13 16:17:26 -07:00
Tomasz Elendt and Matthias Kramm
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 and Matthias Kramm
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 and Jukka Lehtosalo
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