NODA, Kai
fe1d7f4fd4
ssl.SSLContext(protocol) >= 3.5 has a default value ( #2007 )
...
Fix #1947
As discussed, pretended all 3.5.* have the default value although it was actually 3.5.3 which introduced it
2018-04-09 12:58:15 -07:00
Jelle Zijlstra
f37709f9c3
Merge stubs for sqlite3 ( #2026 )
...
As promised in #2014 .
There are virtually no real changes between Python 2 and 3 in this module, but the stub had accumulated some meaningless differences. I also fixed a few incorrect types.
2018-04-09 12:32:59 -07:00
Jelle Zijlstra
3f456e335e
add multiprocessing.Process.kill and close ( #2027 )
...
See https://docs.python.org/3.7/library/multiprocessing.html#multiprocessing.Process.kill .
Fixes #2022 .
2018-04-09 12:04:14 -07:00
Jelle Zijlstra
482f207b3c
os.fwalk supports bytes ( #2013 )
...
python/cpython@8f6b344 and https://bugs.python.org/issue28682 .
I could not use the _PathLike alias because that includes bytes.
Part of #1965 .
2018-04-06 11:22:15 -07:00
Jelle Zijlstra
54ecefef04
removals in Python 3.7 ( #2018 )
...
Last part of #1965 .
2018-04-06 11:11:29 -07:00
Jelle Zijlstra
0acdfd1548
more 3.7 features ( #2017 )
2018-04-06 11:09:45 -07:00
Jelle Zijlstra
7cfbc7d17f
more 3.7 features ( #2015 )
2018-04-06 11:09:11 -07:00
Jelle Zijlstra
ce0656a8c7
add some more Python 3.7 features ( #2014 )
2018-04-06 11:08:30 -07:00
Alan Du
bd26c7bf84
Add __complex__ to complex ( #2004 )
...
* Add __complex__ to complex
complex SupportsComplex!
* Allow constructing complex from SupportsComplex
2018-04-03 07:14:52 -07:00
Matt Gilson
8e3182dafa
dict.fromkeys supports arbitrary iterables. ( #2012 )
...
This should fix #1529 .
2018-04-03 07:12:04 -07:00
Jelle Zijlstra
43e6c3c435
add more minor 3.7 new features ( #2000 )
...
part of #1965
2018-03-28 21:28:27 -07:00
Jelle Zijlstra
26e573ba1c
change default value to ... in inspect.pyi ( #1998 )
...
This is in our style guide. This is the last piece of offending code; I just submitted ambv/flake8-pyi#10 to enforce the rule in the linter in the future.
2018-03-28 20:24:39 -07:00
Jelle Zijlstra
200273edeb
add stub for importlib.resources ( #1993 )
...
Part of #1965
2018-03-28 18:44:40 -07:00
Jelle Zijlstra
103056eecf
fix some TODOs ( #1994 )
...
- Made deque.maxlen read-only
- We don't support 3.2, so we don't care about signature changes in it
- There don't seem to be any missing set operations (I compared the dir() of this class to that of builtins.set)
2018-03-28 18:40:13 -07:00
Russell Cloran
a62c6be905
Make encoding and newline optional in tempfile ( #1995 )
...
`encoding` and `newline` have a default value of `None` in stdlib, for all of
the classes/functions that take these parameters.
2018-03-28 16:41:24 -07:00
Eric Wieser
6cf1ec9654
Mark all dunder attributes of BaseException as Optional ( #1992 )
...
All of these properties can be set to `None`.
Also updates `with_traceback` to only accept the values which can be stored in `__traceback__`
2018-03-28 07:55:10 -07:00
Semyon Proshev
ac70fdc614
Overloads for map ( #1990 )
2018-03-27 10:05:59 -07:00
Tuomas Suutari
4da20cb8b7
multiprocessing: Fix timeout args of AsyncResult methods ( #1984 )
...
The timeout argument of wait and get methods of AsyncResult accepts also
None so fix the type specification to include Optional.
Accepting None is not an implementation detail as it's clearly
documented too:
https://docs.python.org/2/library/multiprocessing.html#multiprocessing.pool.AsyncResult
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.AsyncResult
2018-03-24 08:15:39 -07:00
matthewfranglen
9a6a7a2e75
See #1977 : Delete DoneAndNotDoneFutures definition ( #1978 )
...
The generic type of the futures provided to the wait method cannot
currently be preserved through this definition. For now deleting the
unused NamedTuple is the best approach.
2018-03-22 07:59:13 -07:00
Jelle Zijlstra
b9c5e811df
allow instantiating TracebackType in 3.7 ( #1967 )
...
See https://docs.python.org/dev/reference/datamodel.html#traceback-objects
and python/cpython#4793.
part of #1965
2018-03-21 15:26:23 -07:00
z33ky
c2c48424da
Add missing collections.defaultdict.__init__ overloads ( #1957 ) ( #1958 )
2018-03-17 08:22:11 -07:00
Sebastian Rittau
97d3cea9d1
Add module constants for smtplib ( #1962 )
2018-03-15 16:01:23 -07:00
rchen152
eda3f36cb9
Make abc.abstractproperty a class inheriting from property. ( #1964 )
2018-03-15 15:59:14 -07:00
Nipunn Koorapati
5af337b438
Add subprocess annotation for TimeoutExpired ( #1954 )
2018-03-13 08:26:59 -07:00
Salvo 'LtWorf' Tomaselli
89e5d9607c
Add missing headers field ( #1946 )
2018-03-06 21:36:33 -08:00
Ethan Smith
1c47458ac6
Add cache_clear to lru_cache ( #1941 )
2018-03-05 18:52:46 -08:00
rchen152
38dc8f5a6a
Switch usages of mypy_extensions.NoReturn over to typing.NoReturn. ( #1942 )
...
* Change mypy_extensions.NoReturn to typing.NoReturn everywhere.
2018-03-05 12:42:29 -08:00
Miguel Gaiowski
a8465da863
Add stub for subprocess.list2cmdline function ( #1898 )
2018-03-02 11:04:22 -08:00
Takuya Akiba
74345aa898
Add missing next method to iterators returned by Pool.imap ( #1926 )
2018-02-28 18:34:30 -08:00
Takuya Akiba
5e37071a42
Fix imports to expose error classes in multiprocessing module ( #1928 )
2018-02-27 09:47:18 -08:00
rchen152
066c434410
Improve the unittest stubs. ( #1927 )
...
* Improvements to stdlib/2/unittest.pyi
* Adds a bunch of missing things.
* Fixes the signatures of assertRaises and failUnlessRaises.
* Corrects the name of a TestCase subclass from CallableTestCase
to FunctionTestCase.
* Makes defaultTestLoader an instance of TestLoader, as it should
be, rather than an alias. Based on https://docs.python.org/2/library/unittest.html and
https://github.com/python/cpython/tree/2.7/Lib/unittest .
* Improvements to stdlib/3/unittest/__init__.pyi
* The constructor arguments to TextTestResult are all required.
* There is a module-level load_tests() function.
* removeResult() returns a bool. Based on https://docs.python.org/3/library/unittest.html and
https://github.com/python/cpython/tree/master/Lib/unittest .
2018-02-27 06:46:10 -08:00
Łukasz Langa
9b6df1d6bc
[tokenize.open] Accept PathLike filename ( #1921 )
...
* [tokenize.open] Accept PathLike filename
* Still accept str, bytes and int on Python 3.6+
2018-02-26 11:01:48 -08:00
Sebastian Rittau
38aea73b4b
Merge Python 2 and 3 versions of time.pyi ( #1909 )
...
* Use variable annotations
* Replace default values by ellipses
* Remove exceptions from function bodies
* Remove superfluous comments
* Remove superfluous newlines
* Use Optional instead of Union[..., None]
* Replace Union[int, float] by just float
* Make time.pyi (Python 2) more closely resemble the Python 3 stub
* Replace _TIME_TUPLE by TimeTuple
* Reorder imports
* time.pyi: Mark two arguments as optional, mark Unix-only function
* time.pyi (Python 2): Use TimeTuple in NamedTuple and reformat
This makes time.pyi more closely match the Python3 version.
* Merge Python 2 and 3 versions of time.pyi
* Only import SimpleNamespace on Python >= 3.3
* Remove default values from module properties
* Remove Optional from strftime() and asctime()
* accept2dyear was removed in Python 3.3
* Rename TimeTuple to _TimeTuple
2018-02-24 11:49:37 -08:00
Jelle Zijlstra
35d3effe03
Remove version check for deque.insert and deque.index ( #1916 )
...
Otherwise, deque is not instantiable in Python 3.4. We could do a dynamic base class instead
but that doesn't seem worth it.
2018-02-24 11:12:56 -08:00
Daniel Li
2c6296034f
Future.set_running_or_notify_cancel returns bool ( #1911 )
...
Future.set_running_or_notify_cancel returns a bool, not None. See commit
13bcc79c12 , where this problem was fixed
for Python 2.
2018-02-22 09:03:37 -08:00
Ivan Levkivskyi
7ae2f25216
Fix some problems introduced by recent commits. ( #1905 )
2018-02-20 13:34:48 -08:00
shahin
d3a9650fa1
Fix return type of re.match, re.search ( #1886 )
2018-02-19 09:23:57 -08:00
David Euresti
8ecb74012a
Add __divmod__ to numeric types ( #1900 )
...
Helps with #1889
2018-02-18 16:59:12 -08:00
Pradyun Gedam
b6bd58268b
Update base class to match the source file ( #1899 )
2018-02-18 09:03:09 -08:00
Łukasz Langa
18ae67d040
[stdlib/3/multiprocessing] Add queues.pyi, make the other stubs use it ( #1879 )
2018-02-16 17:00:44 -08:00
Roy Williams
71c2a94cb8
Allow os.listdir to accept a PathLike in Python3.6 ( #1894 )
2018-02-16 16:42:58 -08:00
Nick Gaya
3e85d6bb61
Add missing unittest.mock.patch attributes ( #1882 )
2018-02-16 09:13:33 -08:00
Marti Raudsepp
d288f443b9
Merge {IO,Environment,Windows}Error into OSError for Python 3.3+ ( #1852 )
...
Starting with Python 3.3, IOError, EnvironmentError and WindowsError are
aliases for OSError, which has all the attributes.
Reference:
* https://docs.python.org/3/library/exceptions.html#OSError
* https://www.python.org/dev/peps/pep-3151/
* OSError: Drop Python <3.3 compatibility
* Use Any instead of Union for filename/filename2 type, per GvR comment
See: https://github.com/python/mypy/pull/4541
2018-02-14 16:33:56 +00:00
rchen152
8d46ada49d
Add undocumented but occasionally used attributes to inspect.pyi. ( #1864 )
...
* Add attributes not in docs to 2/inspect.pyi.
* Add attributes not in docs to 3/inspect.pyi.
* Change list to List[Any] in 2/inspect.pyi
2018-02-14 16:20:55 +00:00
Salvo 'LtWorf' Tomaselli
b33c7d1a84
Add missing private field to NamedTuple ( #1866 )
...
It is very useful for doing introspection.
2018-02-14 16:11:19 +00:00
Karl Ramm
c5bb3aa547
mypy gets confused if you leave out 'self' ( #1871 )
2018-02-10 13:24:05 -08:00
Rhys Parry
6b82088e20
Add UserDict attribute data for Python 3 ( #1863 )
2018-02-09 07:55:58 -08:00
Chad Dombrova
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
George King
1533602779
filter function: make the callable of the first overload non-optional so that mypy is able to select the second overload for the case. ( #1855 )
2018-02-05 10:50:40 -08:00
Marti Raudsepp
15f07f5d03
Add ImportError attributes name, path for Python 3.3+ ( #1849 )
...
Reference: https://docs.python.org/3/library/exceptions.html#ImportError
2018-02-01 07:38:26 -08:00