Commit Graph

109 Commits

Author SHA1 Message Date
Jelle Zijlstra db0c106d2f add Optional to ddirs 2017-03-18 15:16:56 -07:00
Jelle Zijlstra efdf2f1b17 add compileall stubs to 3 and add types to the ones in 2 (#1023)
* add compileall stubs to 3 and add types to the ones in 2

Didn't merge the stubs because all functions have additional parameters since 3.2,
so there would be no shared code between 2 and 3.

* add comment
2017-03-18 14:55:47 -07:00
Jelle Zijlstra 52dcfeed12 merge 2 and 3 stubs for unicodedata (#1013)
* merge 2 and 3 stubs for unicodedata
* fix a few return types to str in py2
2017-03-17 10:39:44 -07:00
Tadeu Manoel da6d4314d3 Add missing method 'indices' in 'slice' builtin (#1007) 2017-03-16 09:18:24 -07:00
Jelle Zijlstra 349ff59f33 change empty bodies from "pass" to "..."
CONTRIBUTING.md says to prefer ... Not the most impactful change but fixing
these will allow us to lint for it in the future and get a consistent style.
2017-03-16 09:13:08 -07:00
Jelle Zijlstra 48b1962951 drop union return type from getaddrinfo (#1002) 2017-03-14 11:45:09 -07:00
=^_^= 45f4a1e913 Allow nested tuples in isinstance/issubclass (#998)
Fixes #997
2017-03-14 08:04:12 -07:00
Ivan Levkivskyi b430318ac0 Fix non-subscriptable type aliases (#993) 2017-03-13 17:24:34 -07:00
Semyon Proshev 52da2a176b Fix datetime stubs (#992) 2017-03-13 09:12:46 -07:00
Jelle Zijlstra eb07fd3c1a make sure typevars defined in stubs are private (#989)
And also a few type aliases I noticed in the process.

Found using https://github.com/JelleZijlstra/stublint/commit/59f9cac0951f431fbc3abf8803adeaac6e489aac
2017-03-13 07:32:40 -07:00
Jelle Zijlstra 155fdd0cd4 Fixes to tempfile stubs (#981)
Fixes #975

And a few more things I noticed while reading the tempfile docs.

    In 3.5, most functions in tempfile were changed to accept either str or bytes in their prefix and suffix arguments, and return bytes or str accordingly. This seemed like a case for AnyStr.
    We were missing tempdirb and tempprefixb, added in 3.5.
    TemporaryFile and others were declared as returning BinaryIO, but they actually return either binary or text IO depending on the mode passed in. I changed the return type to IO[Any], similar to builtins.open.
2017-03-12 19:32:46 -07:00
Matthias Kramm 02bd2bdf69 Make pickle accept IO[str] instead of BinaryIO. (#980)
* Make pickle accept IO[str] instead of BinaryIO.

This makes the following code work:
pickle.Unpickler(cStringIO.StringIO())
(Which didn't work before because cStringIO.StringIO inherits "only"
 from IO[str], not BinaryIO)

* Use bytes instead of str.
2017-03-10 20:24:20 -08:00
Jelle Zijlstra cf6c563ce1 codecs: merge 2 and 3 stubs (#960) 2017-03-10 15:50:14 -08:00
Ivan Levkivskyi bd5b33f3b1 Fix frozenset (#979) 2017-03-10 13:59:32 -08:00
Dominik Miedziński 4f51a4f2fc Improve ABCMeta.register signature (#962)
* Improve ABCMeta.register signature

* Fix ABCMeta.register return type for Python 3.3+
2017-03-07 16:42:06 -08:00
rchen152 f34c550f04 Correct some return types in itertools.pyi from Iterable to Iterator. (#947)
* Fix a few return types in stdlib/2/inspect.pyi.

* Rename _FrameRecord to _FrameInfo

* Correct some return types in itertools.pyi from Iterable to Iterator.
2017-03-07 06:42:50 -08:00
David Euresti 91ff50ad7a Fix AbstractDigestAuthHandler to have correct types. 2017-02-22 20:29:17 -08:00
David Euresti 70e39d9ad2 Fix and unify type of socket.getaddrinfo 2017-02-22 20:24:47 -08:00
David Euresti f7aedb4d21 Fix type annotations in fnmatch for Python 2.
Make some AnyStr others _EitherStr.
2017-02-22 20:15:35 -08:00
Andrey Vlasovskikh 295788b672 Missing special attributes of class instances inherited from object (#943)
* Missing special attributes of class instances inherited from object
* object.__reduce__ returns a tuple

It's up to its inheritors to return either a tuple or a string.
2017-02-20 11:50:14 -08:00
David Euresti dbea48fc7a Make 2nd argument to ModuleType an optional kwarg (#941) 2017-02-20 11:10:59 -08:00
Andrey Vlasovskikh 39d89ef233 Class 'property' inherits from 'object' for PY2 2017-02-20 11:04:27 -08:00
Andrey Vlasovskikh 7212f23f7b Added missing 'property' attributes 2017-02-20 11:04:27 -08:00
Andrey Vlasovskikh 43c1369901 More precise type for 'slice' constructor
start and stop arguments are required even though they can be None.
2017-02-20 11:03:30 -08:00
Matthias Kramm f869a5d351 fix bugs in stdlib/2/csv.py (#932) 2017-02-13 20:21:19 -08:00
Jelle Zijlstra a778704b30 add Counter, Deque, ChainMap (#928) 2017-02-11 10:52:09 -08:00
Tom Manderson 65b45282f4 Update python 2 UUID stubs (#922) 2017-02-08 15:19:56 -08:00
Matthias Kramm 7a211921dd asctime/strftime take a tuple, too (#921) 2017-02-07 16:22:47 -08:00
David Euresti db84eb7844 Fix hashlib to accept multiple data types (#918) 2017-02-06 17:24:48 -08:00
David Euresti 6eca1a04da Some ssl fixes (#919)
Fix return of wrap_socket.
Add read, write, pending to SSLSocket
Fix argument to socket.setdefaulttimeout
2017-02-06 17:23:22 -08:00
rchen152 c9e992ea8d Fix a few return types in stdlib/2/inspect.pyi. (#916) 2017-02-06 08:19:14 -08:00
Mike Patek c760a4e949 Make OrderedDict inherit from Reversible (#912)
Fixes #904
2017-02-01 09:23:43 -08:00
Matthias Kramm b240b241f0 add stdlib/2/repr.pyi (#910) 2017-01-31 14:56:48 -08:00
Matthias Kramm 6855a20a51 add TestCase.failureException (#907) 2017-01-31 14:37:52 -08:00
Matthias Kramm 295ffbe4f3 improve inspect.pyi (#908) 2017-01-31 14:34:18 -08:00
Matthias Kramm 293dcfa661 fix socket.sendto (#909) 2017-01-31 14:32:15 -08:00
Matthias Kramm 987f465b4f add missing import 2017-01-31 09:25:45 -08:00
Valérian Rousset fe15d91041 merge */xml/etree into 2and3/xml/etree (#899)
Fixes #287.
2017-01-30 13:19:28 -08:00
Lucas Wiman 7c93bb07e1 Update annotations for unittest.skip* methods. (#877) 2017-01-29 20:33:49 -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
Matt Kimball bb5ba13315 Moved syslog from 2/ to 2and3/. Allow both forms of syslog.syslog. (#884) 2017-01-29 20:19:13 -08:00
miedzinski d486e2a8d5 Add typing.ClassVar (fixes #888) (#889) 2017-01-29 17:15:04 -08:00
Andrey Vlasovskikh 2d46679da8 Added attributes present in inheritors of types.InstanceType (#885) 2017-01-29 11:26:30 -08:00
Andrey Vlasovskikh bb33cb0119 Added __instancecheck__ and __subclasscheck__ to type (#887) 2017-01-29 11:17:01 -08:00
Andrey Vlasovskikh 8ce64ce782 Updates to slice built-in (#891)
Makes args and attributes optional.
2017-01-29 11:16:23 -08:00
Andrey Vlasovskikh 2b25b3ef6d Argument of input() is not restricted to str (#890) 2017-01-29 10:34:32 -08:00
Lucas Wiman c048984ab9 Update stub of str to match documentation. (#893) 2017-01-29 10:14:32 -08:00
Lucas Wiman 6d1edb285d Expand several stdlib methods to accept unicode or str. (#869)
Expand several stdlib methods to accept unicode or str.
2017-01-27 16:03:25 +00:00
Andrey Vlasovskikh c8435f4315 Added object.__sizeof__ (#865)
* Added object.__sizeof__

* Removed __sizeof__ inherited from object

* Made sqlite3 classes for Python 2 inherit from object

* Removed __sizeof__ inherited from object
2017-01-26 12:05:53 -08:00
Andrey Vlasovskikh 025f31dcc9 Added class super to builtins (#867) 2017-01-26 11:53:59 -08:00