Commit Graph

4054 Commits

Author SHA1 Message Date
Nikita Sobolev
67766f282f Use import instead of re-definition of constants in subprocess (#7065) 2022-01-28 00:09:33 -08:00
Sebastian Rittau
b87ebc5375 Don't use a literal for TYPE_CHECKING (#7062)
Partly addresses #7061
2022-01-27 23:51:22 -08:00
Alex Waygood
dbb5488b31 Do not use True or False as default values in assignments (#7060) 2022-01-27 13:51:36 -08:00
Nikita Sobolev
d43639d289 Improve asyncio.Future type (#7058) 2022-01-27 12:46:43 -08:00
Alex Waygood
0e185f4087 Improve inspect stubs (#7050) 2022-01-27 09:04:48 -08:00
Alex Waygood
f7a7e0b386 Improve unittest.removeHandler in Python 2 (#7055)
This brings the signature in line with the signature of `removeHandler` in Python 3:

a54e21992c/stdlib/unittest/signals.pyi (L11-L14)
2022-01-27 09:04:18 -08:00
Alex Waygood
2d8decd237 Backport many ParamSpec-related changes to Python 2 (#7054) 2022-01-27 07:57:26 -08:00
Nikita Sobolev
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
56aa2088aa Add BufferedProtocol.eof_received() (#7043) 2022-01-27 12:09:29 +01:00
Jelle Zijlstra
d5101dced7 Fix float.__rpow__ (#7047)
Fixes #7046.
2022-01-26 19:18:42 -08:00
Andrew Svetlov
98afaa4c76 Fix loop.remove_reader() and loop.remove_writer() return types (#7042) 2022-01-26 14:52:15 +01:00
Tom Parker-Shemilt
01510448a9 Python 2: io.IOBase.readline accepts None (#7041) 2022-01-26 11:32:20 +02:00
Nikita Sobolev
9651f6fa04 Use better types for time.get_clock_info (#7040) 2022-01-26 11:09:31 +02:00
Nikita Sobolev
c52bddb459 Use existing type alias in timeit (#7039) 2022-01-26 10:51:26 +02:00
Alex Waygood
5d07ebc864 Use PEP 585 syntax in typing and typing_extensions, and remove module-level defaults where possible (#7036) 2022-01-25 16:13:36 +01:00
Nikita Sobolev
bfda5c640b Add mixins module to asyncio (#6789) 2022-01-25 12:53:55 +01:00
Vlad Starostin
fab2a47f9b Use stricter transport types in asyncio subprocess methods (#7026)
Co-authored-by: Vlad Starostin <vladstar@yandex-team.ru>
2022-01-25 11:07:36 +01:00
Nikita Sobolev
20508d05f4 Use ParamSpec in unittest.case (#7012) 2022-01-25 10:25:28 +01:00
Nikita Sobolev
03a7ac59c9 Use @overload for sunau.open (#7033) 2022-01-25 10:22:56 +01:00
Nikita Sobolev
9a89e09753 Removed unused # noqa: F403 (#7032) 2022-01-25 09:21:11 +01:00
Alex Waygood
6346464aed Use import instead of type alias in email/message.pyi (#7022) 2022-01-24 13:00:29 +01:00
Nikita Sobolev
c8bfa511f7 Add TODO to support Concatenate in curses (#7018) 2022-01-24 12:13:18 +02:00
Nikita Sobolev
dc176d70ec Use ParamSpec in unittest.async_case (#7011) 2022-01-23 13:54:06 -08:00
Nikita Sobolev
166d6c618c Use ParamSpec in profile.Profile.runcall (#7010) 2022-01-23 13:34:40 -08:00
Nikita Sobolev
a4db42ee34 Use ParamSpec in pdb.runcall (#7009) 2022-01-23 13:34:34 -08:00
Nikita Sobolev
5b45601ed3 Use ParamSpec in cProfile.Profile.runcall (#7008) 2022-01-23 13:34:26 -08:00
Nikita Sobolev
2244bdfa15 Use ParamSpec in contextlib (#7007) 2022-01-23 13:22:05 -08:00
Nikita Sobolev
8502c8635f Use ParamSpec for bdb.Bdb.runcall (#7006) 2022-01-23 13:17:16 -08:00
Nikita Sobolev
e6cf110100 Improve FunctionType.__get__ with @overload (#7005) 2022-01-23 12:38:09 -08:00
Nikita Sobolev
64bb71d7c1 Improve >, <, etc for UUID type (#7001) 2022-01-23 18:59:56 +01:00
Akuli
dff461fc6a improve tkinter.Treeview.heading and tkinter.Treeview.item (#6999) 2022-01-23 14:53:30 +01:00
Nikita Sobolev
c339159cbf Improve wave.open type with overloads (#7000) 2022-01-23 14:39:31 +01:00
Nikita Sobolev
7ab84cfebf Fix writeframes type in wave (#6997) 2022-01-22 12:11:58 -08:00
Jelle Zijlstra
de5ec6a0d1 fix incorrect tuple[T] (#6996)
Found from PyCQA/flake8-pyi#135.
2022-01-22 09:37:14 -08:00
Nikita Sobolev
16e9292561 Use ParamSpec for weakref.finalize (#6992) 2022-01-22 07:26:37 -08:00
Akuli
a22ca2ec51 make the default positional-or-keyword in Mapping.get and MutableMapping.pop (#6694) 2022-01-22 07:19:01 -08:00
q0w
4e97b06175 Use MutableMapping for headers (#6969) 2022-01-22 12:01:29 +02:00
Alex Waygood
d053d8ffea Make mapping attribute read-only on dict views classes (#6991) 2022-01-22 11:49:59 +02:00
Nikita Sobolev
f5db1ccbbd Use tuple of Literal types in functools.pyi (#6915) 2022-01-21 20:51:52 -08:00
Jasha10
7c4ca27083 builtins.filter compat with typing.TypeGuard (#6726)
This change enables the following use-case:
```python
def is_not_none(x: Optional[int]) -> TypeGuard[int]:
    return x is not None

list_optional: list[Optional[int]] = [0, None, 1, None, 2]
generate_ints: Iterable[int] = filter(is_not_none, list_optional)
```

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-01-21 20:48:02 -08:00
Nikita Sobolev
70e51f6f20 Use Literal types in zlib (#6988) 2022-01-21 08:50:30 -08:00
Alex Waygood
76af72831a Use the Literal["foo", "bar"] syntax consistently (#6984) 2022-01-20 20:16:04 +02:00
Nikita Sobolev
7dd35556c4 Use more precise type for gettext.find (#6980)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-01-20 18:43:18 +02:00
Versus
556e623a81 Add mmap.MAP_POPULATE from 3.10 (#6964) 2022-01-20 14:30:27 +01:00
Alex Waygood
bcd9ca47f6 Remove unneeded # noqa comment (#6979) 2022-01-20 14:11:23 +01:00
Nikita Sobolev
e553f8cb5a Use stricter Random.seed type (#6924) 2022-01-19 22:23:41 -08:00
Christian Bundy
4d085fbfc1 Fix strtobool type annotation (#6970)
Problem: strtobool returns either 0 or 1, not bool.

Solution: Fix type annotation.
2022-01-19 21:57:47 -08:00
Jelle Zijlstra
1f000d2881 Improve type for setdefault() (#6941)
- With one argument, it may return None
- With two arguments, it returns the default's type or the dict's value type.
- Also remove incorrect `= ...` from `pop()`. The one-argument case has its own overload.

Context: https://github.com/python/typing/discussions/1033#discussioncomment-1986359

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-01-19 21:44:15 -08:00
Alex Waygood
aea52b35d1 Remove nearly all __str__ and __repr__ methods from typeshed (#6968) 2022-01-20 00:45:11 +01:00
Alex Waygood
fe6233a8c3 Add Y027 to list of ignored .flake8 error codes (#6962)
Refs https://github.com/PyCQA/flake8-pyi/pull/104
2022-01-19 07:17:30 -08:00