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
Karl Ramm and Guido van Rossum
c5bb3aa547
mypy gets confused if you leave out 'self' ( #1871 )
2018-02-10 13:24:05 -08:00
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
George King and Jelle Zijlstra
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 and Jelle Zijlstra
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
Semyon Proshev and Jelle Zijlstra
3e00a8f8e1
PEP 553 and PEP 564 ( #1846 )
...
* Add `breakpoint` to builtins (PEP 553)
* Add new `time` functions (PEP 564)
2018-01-31 16:51:25 -08:00
gossrock and Jelle Zijlstra
79e0b94ef1
adding curses.ascii, curses.panel and curses.textpad modules ( #1792 )
...
* adding ascii, panal and textpad modules to the curses module.
* added curses/panel.pyi and curses/textpad.pyi to test/pytype_blacklist.txt
just like curses/__init__.pyi because they all import _curses. (This
may not be the right thing to do)
2018-01-26 14:39:55 -08:00
Sebastian Rittau and Jelle Zijlstra
6d7173b70b
Add StringIO.name and BytesIO.name ( #1802 )
...
Also, change the type of StringIO.name (Python 3) from str to Any.
Neither StringIO nor BytesIO actually define a name field, but the
super-class IO[T] of both in typeshed does define a read-only property.
This means that sub-classes of StringIO and BytesIO adding this field
will not typecheck correctly.
Closes : #1790
2018-01-26 14:34:06 -08:00
rchen152 and Jelle Zijlstra
66e5863ead
Change the return type of unittest.TestCase.fail() to NoReturn ( #1843 )
...
* Change the return type of unittest.TestCase.fail() to NoReturn
* Import mypy_extensions.NoReturn instead of typing.NoReturn
2018-01-26 14:28:37 -08:00
Yuri Khan and Jelle Zijlstra
468d2fa629
_curses.tparm works on bytes, not str ( #1828 )
...
The documentation refers to the first argument as `str`
but careful reading reveals that its type,
and the function return type, is `bytes`.
2018-01-23 14:31:59 -08:00