Jelle Zijlstra and Łukasz Langa
b1a0b8ad6e
add subprocess.STARTUPINFO and some associated constants ( #2041 )
2018-04-12 12:29:42 -07:00
Jelle Zijlstra and Łukasz Langa
37aba00fe8
fix using ZipFile as a ContextManager ( #2043 )
2018-04-12 12:29:22 -07:00
Jelle Zijlstra and Guido van Rossum
7cd2016931
add sys.base_exec_prefix and sys.base_prefix ( #2047 )
...
See https://docs.python.org/3/library/sys.html#sys.base_exec_prefix .
Required for https://github.com/python/mypy/pull/4888
2018-04-11 13:59:44 -07:00
Svend Sorensen and Jelle Zijlstra
6c1dffed58
Make islice start and stop parameters optional ( #2031 )
...
From the documentation [1]: "If start is None, then iteration starts at zero."
[1] https://docs.python.org/3/library/itertools.html#itertools.islice .
PR #1603 made this change for Python 2.
2018-04-10 20:55:06 -07:00
John Reese and Jelle Zijlstra
a51b480609
Add type annotations for multiprocessing manager address/connect ( #2033 )
2018-04-10 20:54:23 -07:00
NODA, Kai and Jelle Zijlstra
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 and Guido van Rossum
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 and Guido van Rossum
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 and Guido van Rossum
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 and Guido van Rossum
54ecefef04
removals in Python 3.7 ( #2018 )
...
Last part of #1965 .
2018-04-06 11:11:29 -07:00
Jelle Zijlstra and Guido van Rossum
0acdfd1548
more 3.7 features ( #2017 )
2018-04-06 11:09:45 -07:00
Jelle Zijlstra and Guido van Rossum
7cfbc7d17f
more 3.7 features ( #2015 )
2018-04-06 11:09:11 -07:00
Jelle Zijlstra and Guido van Rossum
ce0656a8c7
add some more Python 3.7 features ( #2014 )
2018-04-06 11:08:30 -07:00
Alan Du and Jelle Zijlstra
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 and Jelle Zijlstra
8e3182dafa
dict.fromkeys supports arbitrary iterables. ( #2012 )
...
This should fix #1529 .
2018-04-03 07:12:04 -07:00
Jelle Zijlstra and GitHub
43e6c3c435
add more minor 3.7 new features ( #2000 )
...
part of #1965
2018-03-28 21:28:27 -07:00
Jelle Zijlstra and Łukasz Langa
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 and GitHub
200273edeb
add stub for importlib.resources ( #1993 )
...
Part of #1965
2018-03-28 18:44:40 -07:00
Jelle Zijlstra and GitHub
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 and Jelle Zijlstra
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 and Jelle Zijlstra
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 and Guido van Rossum
ac70fdc614
Overloads for map ( #1990 )
2018-03-27 10:05:59 -07:00
Tuomas Suutari and Jelle Zijlstra
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 and Jelle Zijlstra
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 and GitHub
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 and Jelle Zijlstra
c2c48424da
Add missing collections.defaultdict.__init__ overloads ( #1957 ) ( #1958 )
2018-03-17 08:22:11 -07:00
Sebastian Rittau and Jelle Zijlstra
97d3cea9d1
Add module constants for smtplib ( #1962 )
2018-03-15 16:01:23 -07:00
rchen152 and Guido van Rossum
eda3f36cb9
Make abc.abstractproperty a class inheriting from property. ( #1964 )
2018-03-15 15:59:14 -07:00
Nipunn Koorapati and Guido van Rossum
5af337b438
Add subprocess annotation for TimeoutExpired ( #1954 )
2018-03-13 08:26:59 -07:00
Salvo 'LtWorf' Tomaselli and Jelle Zijlstra
89e5d9607c
Add missing headers field ( #1946 )
2018-03-06 21:36:33 -08:00
Ethan Smith and Jelle Zijlstra
1c47458ac6
Add cache_clear to lru_cache ( #1941 )
2018-03-05 18:52:46 -08:00
rchen152 and Matthias Kramm
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 and Guido van Rossum
a8465da863
Add stub for subprocess.list2cmdline function ( #1898 )
2018-03-02 11:04:22 -08:00
Takuya Akiba and Jelle Zijlstra
74345aa898
Add missing next method to iterators returned by Pool.imap ( #1926 )
2018-02-28 18:34:30 -08:00
Takuya Akiba and Jelle Zijlstra
5e37071a42
Fix imports to expose error classes in multiprocessing module ( #1928 )
2018-02-27 09:47:18 -08:00
rchen152 and Matthias Kramm
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 and Jelle Zijlstra
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 and Jelle Zijlstra
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 and GitHub
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 and Jelle Zijlstra
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 and Jelle Zijlstra
7ae2f25216
Fix some problems introduced by recent commits. ( #1905 )
2018-02-20 13:34:48 -08:00
shahin and Jelle Zijlstra
d3a9650fa1
Fix return type of re.match, re.search ( #1886 )
2018-02-19 09:23:57 -08:00
David Euresti and Jelle Zijlstra
8ecb74012a
Add __divmod__ to numeric types ( #1900 )
...
Helps with #1889
2018-02-18 16:59:12 -08:00
Pradyun Gedam and Guido van Rossum
b6bd58268b
Update base class to match the source file ( #1899 )
2018-02-18 09:03:09 -08:00
Łukasz Langa and Jelle Zijlstra
18ae67d040
[stdlib/3/multiprocessing] Add queues.pyi, make the other stubs use it ( #1879 )
2018-02-16 17:00:44 -08:00
Roy Williams and Jelle Zijlstra
71c2a94cb8
Allow os.listdir to accept a PathLike in Python3.6 ( #1894 )
2018-02-16 16:42:58 -08:00
Nick Gaya and Jelle Zijlstra
3e85d6bb61
Add missing unittest.mock.patch attributes ( #1882 )
2018-02-16 09:13:33 -08:00
Marti Raudsepp and Łukasz Langa
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 and Łukasz Langa
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 and Łukasz Langa
b33c7d1a84
Add missing private field to NamedTuple ( #1866 )
...
It is very useful for doing introspection.
2018-02-14 16:11:19 +00:00