806c26045e
Improve itertools stubs ( #7109 )
...
There are quite a few `__iter__` methods in `itertools` that return `self` at runtime. They should do so in the stubs as well.
Co-authored-by: Sebastian Rittau <srittau@rittau.biz >
2022-02-02 08:37:41 -08:00
Alex Waygood and GitHub
f50255025a
calendar.different_locale.__enter__ returns None, not _LocaleType (#7108 )
2022-02-02 16:28:18 +01:00
Sebastian Rittau and GitHub
2dc53caffe
Improve abc module and builtin function decorators ( #5703 )
2022-02-02 16:22:32 +01:00
Alex Waygood and GitHub
584336a41e
Fix several methods that should be async def, but aren't ( #7107 )
2022-02-02 15:18:14 +01:00
Nikita Sobolev and GitHub
1b99812621
Require coroutines for create_task() ( #6779 )
2022-02-02 13:35:00 +01:00
Nikita Sobolev and GitHub
970b8a676c
Use async def instead of def ... -> Awaitable in typing ( #7105 )
2022-02-02 13:14:08 +01:00
Nipunn Koorapati and GitHub
90f5422df7
Add/fix types to a bunch of non-generated protobuf files ( #7017 )
2022-02-02 12:30:39 +01:00
Ilya Kulakov and GitHub
f2ce1d1d21
bisect: insort_* expects x to match type of elements of a ( #7102 )
2022-02-02 12:21:11 +01:00
Rajiv Bakulesh Shah and GitHub
beac964588
Redis: Annotate .lolwut() ( #7104 )
2022-02-02 11:18:11 +01:00
7e053ac5bd
Add some missing type hints to tkinter ( #6359 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2022-02-02 10:29:11 +02:00
Alex Waygood and GitHub
3e6375e606
Delete commented-out pydoc.Scanner class ( #7100 )
2022-02-01 19:46:51 +02:00
Alex Waygood and GitHub
023e21dedf
Delete SupportsAnyComparison type in _typeshed ( #7098 )
2022-02-01 14:32:20 +01:00
Sebastian Rittau and GitHub
54fde0c2a1
Improve protocol return types ( #7093 )
...
* Dunder comparisons must return bool.
* write() return type should be ignored.
* Use custom comparison protocols in _operator.pyi
2022-02-01 08:59:07 +01:00
Ilya Kulakov and GitHub
587d15a9bc
bisect: fix type of x when key is present ( #7097 )
2022-01-31 17:49:58 -08:00
Alex Waygood and GitHub
f86f096e1c
Use literal types in lzma ( #7095 )
2022-01-31 10:46:26 -08:00
UncleOwen and GitHub
8631ed9e57
requests.Session: Accept hooks and lists of hooks ( #7094 )
2022-01-31 11:29:05 +01:00
Sebastian Rittau and GitHub
cb3c1bb638
Replace IO with protocols ( #7092 )
2022-01-31 11:39:56 +02:00
Rajiv Bakulesh Shah and GitHub
064317a72e
Redis: Annotate .pttl(), .dump(), and .getdel() ( #7091 )
2022-01-31 08:30:46 +01:00
Jelle Zijlstra and GitHub
2b72dea679
Allow ExitStack.push callbacks to return None ( #7090 )
2022-01-31 08:21:32 +01:00
Shantanu and GitHub
b88a6f19cd
Upgrade black version ( #7089 )
2022-01-30 16:27:06 -08:00
Nikita Sobolev and GitHub
9854926289
function argument in shutil.register_unpack_format must be Callable (#7083 )
2022-01-30 11:29:36 -08:00
D. Spindel and GitHub
136592666b
FileFinder takes a class, not an instance ( #7085 ) ( #7086 )
...
The FileFinder takes a tuple of (class, arguments) to instantiate for
each time, rather than an existing instance.
Fixes #7085
2022-01-30 08:44:01 -08:00
Nikita Sobolev and GitHub
1a71371dda
Use dbm._TFlags in shelve.open ( #7084 )
2022-01-30 14:05:52 +01:00
Jelle Zijlstra and GitHub
3b29006a3e
email.generator: Use protocols instead of TextIO/BinaryIO ( #7082 )
2022-01-30 14:02:11 +01:00
45a2dad83c
Reduce use of Any in equality methods ( #7081 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2022-01-30 00:59:00 +02:00
lovetox and GitHub
9aeecb4c35
pyOpenSSL: Adapt to changes in 22.0.0 ( #7080 )
2022-01-30 00:05:59 +02:00
Alex Waygood and GitHub
d59fb394e7
Remove unused TypeVar ( #7079 )
...
Flagged by https://github.com/PyCQA/flake8-pyi/pull/161
2022-01-29 11:36:02 -08:00
Alex Waygood and GitHub
99cec2d16b
Reduce duplication of code between typing and typing_extensions ( #7075 )
2022-01-29 07:44:42 -08:00
Nikita Sobolev and GitHub
54eef59fe4
Improve shlex.push_source types ( #7071 )
2022-01-29 11:41:19 +02:00
Alex Waygood and GitHub
7e79706ddd
Clarify why some module-level objects in typing have default values ( #7037 )
2022-01-28 17:38:25 -08:00
Nipunn Koorapati and GitHub
470ea31ccd
Use relax_strict_optional_primitives on protobuf generated code ( #7038 )
...
Per the suggestion in https://github.com/dropbox/mypy-protobuf/issues/344
This generates more permissive constructors (which protobuf itself actually
accepts).
Philosophically, I think it makes sense for the generated code hosted on
typeshed to be most permissive, while the generated code of individual
projects can make individual decisions (defaulting to less permissive).
2022-01-28 17:37:57 -08:00
Alex Waygood and GitHub
33ecb68603
Fix return annotations of several methods that return self at runtime ( #7070 )
2022-01-28 17:37:49 -08:00
Nikita Sobolev and GitHub
749d3db815
Make asyncio.isfuture a TypeGuard ( #7057 )
2022-01-28 11:08:31 -08:00
Andrew Soutar and GitHub
220a8d1be9
Add __enter__/__exit__ to pymysql.Connection ( #7069 )
2022-01-28 19:57:21 +01:00
Alex Waygood and GitHub
390634b96b
Improve weakref.WeakValueDictionary.__init__ ( #7068 )
2022-01-28 12:35:26 +01:00
Sebastian Rittau and GitHub
6746e83f52
Counter/defaultdict: Key type 'str' if initialized with keywords ( #7048 )
2022-01-28 12:41:58 +02:00
92d135a37c
Use TypeGuard in ElementTree.pyi ( #7059 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-01-28 11:33:45 +02:00
Sebastian Rittau and GitHub
4390b88986
Update redis stubs for 4.1.2 ( #7064 )
2022-01-28 11:30:23 +02:00
Nikita Sobolev and GitHub
67766f282f
Use import instead of re-definition of constants in subprocess ( #7065 )
2022-01-28 00:09:33 -08:00
Sebastian Rittau and GitHub
b87ebc5375
Don't use a literal for TYPE_CHECKING ( #7062 )
...
Partly addresses #7061
2022-01-27 23:51:22 -08:00
Martin Fischer and GitHub
40f5fcc82f
Add babel.core.get_global ( #7063 )
2022-01-28 08:46:24 +01:00
Alex Waygood and GitHub
dbb5488b31
Do not use True or False as default values in assignments ( #7060 )
2022-01-27 13:51:36 -08:00
Nikita Sobolev and GitHub
d43639d289
Improve asyncio.Future type ( #7058 )
2022-01-27 12:46:43 -08:00
Alex Waygood and GitHub
0e185f4087
Improve inspect stubs ( #7050 )
2022-01-27 09:04:48 -08:00
Alex Waygood and GitHub
f7a7e0b386
Improve unittest.removeHandler in Python 2 ( #7055 )
...
This brings the signature in line with the signature of `removeHandler` in Python 3:
https://github.com/python/typeshed/blob/a54e21992c26485edb374e1287a7e9c073d6a9ae/stdlib/unittest/signals.pyi#L11-L14
2022-01-27 09:04:18 -08:00
Alex Waygood and GitHub
2d8decd237
Backport many ParamSpec-related changes to Python 2 ( #7054 )
2022-01-27 07:57:26 -08:00
Alex Waygood and GitHub
5b39d07cd9
Add ParamSpec to decorator.contextmanager ( #7051 )
...
There may be other places in this package where `ParamSpec` could be used, but this one is the most clear-cut.
2022-01-27 07:35:19 -08:00
Alex Waygood and GitHub
e01fc81497
Improve contextvars.Context ( #7052 )
...
Similar changes to the ones @sobolevn made in #6942
2022-01-27 07:33:53 -08:00
Nikita Sobolev and GitHub
97c490aec0
Fix sys.path_hooks type ( #7049 )
...
Docs: https://docs.python.org/3/library/sys.html#sys.path_hooks
2022-01-27 07:21:02 -08:00
Andrew Svetlov and GitHub
56aa2088aa
Add BufferedProtocol.eof_received() ( #7043 )
2022-01-27 12:09:29 +01:00