Commit Graph

62 Commits

Author SHA1 Message Date
Akuli
fbd7963fd6 Delete tkinter._ExceptionReportingCallback (#10689)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-12 20:16:47 +03:00
Alex Waygood
23249c07a9 Update enum for py312 (#10670) 2023-09-11 11:26:18 +01:00
Alex Waygood
6eec191739 Improve the accuracy of (default)dict.__(r)or__ (#10679) 2023-09-08 11:22:17 +01:00
Shantanu
4df9634427 Remove pathlib.PurePath.__eq__ (#10662)
Fixes #10661

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-07 00:40:24 -07:00
Alex Waygood
ef758b66c0 Bump mypy to 1.5.1 (#10559) 2023-08-16 12:18:31 -07:00
Sebastian Rittau
7ea173c4ad Fix @patch when new is missing (#10459) 2023-07-14 12:53:13 +02:00
Nikita Sobolev
a8051fb2c4 Add _generate_next_value_ to StrEnum (#10390)
Fixes https://github.com/python/typeshed/issues/10384

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-01 18:28:09 +01:00
Alex Waygood
8ec2323c0a Replace static assertion that fails with pyright (#10335)
See https://github.com/python/typeshed/pull/10325#issuecomment-1598684045

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-06-20 14:56:14 +01:00
Shantanu
9e86c6026a unittest.mock: use ParamSpec in patch (#10325)
Fixes #10324
2023-06-20 13:48:49 +02:00
Sebastian Rittau
5f9d05c7f5 TemporaryFile(): Handle one more case correctly (#10284) 2023-06-14 05:33:01 -07:00
Alex Waygood
d1bfd08b4b Allow passing multiprocessing.Queues to QueueListener/QueueHandler (#10169) 2023-05-10 17:06:41 +02:00
Wesley Collin Wright
cedf3b5684 stdlib/xml: fix return types for toxml/toprettyxml methods (#10061) 2023-04-22 16:36:57 -06:00
Akuli
03b8c60a02 Support dict(foo.split() for foo in bar) with bytes (#10072) 2023-04-22 18:28:34 +03:00
Alex Waygood
21d7f7153b [alt] typing: accept buffers in IO.write (#9861)
Co-authored-by: JelleZijlstra <jelle.zijlstra@gmail.com>
2023-03-15 00:42:10 -07:00
Thomas M Kehrenberg
d76259a062 Add __name__ to _Wrapped in functools (#9835) 2023-03-03 15:02:51 +00:00
Thomas M Kehrenberg
40d853cbe2 Add __set__ to functools.cached_property (#9762) 2023-02-20 12:36:45 +00:00
Alex Waygood
4ca0c48425 Improve the first overload of is_dataclass (#9758) 2023-02-19 06:26:11 -08:00
Avasam
965b3108fe Further improve and simplify pyright configuration (#9714) 2023-02-12 22:42:23 +01:00
Alex Waygood
8e7b78a8e8 Bump black to 23.1.0 (#9647) 2023-02-01 06:06:04 -08:00
Alex Waygood
9e71de0421 Improve several stdlib setdefault methods (#9612) 2023-01-31 15:39:24 -08:00
Alex Waygood
32ebe323f5 Use a TypeGuard for dataclasses.is_dataclass(); refine asdict(), astuple(), fields(), replace() (#9362) 2023-01-28 15:14:22 +00:00
Alex Waygood
7f986bdf85 Add more overloads to the re stubs to help out pyright (#9592) 2023-01-27 18:32:50 -08:00
Joshua Bronson
1ba0c9815e Fix false positive with calling .register() on KeysView subclass (#9348)
* Revert "`Collection` is `Sized` (#8977)"

This reverts commit 5bbba5d008.

* Revert "typing: remove metaclass from Sized (#9058)"

This reverts commit a3ce512095.

* Add regression test for issue 9296.
2022-12-10 10:09:28 -08:00
Alex Waygood
01e78c7e81 Use modern syntax in test-case files where possible (#9261) 2022-11-23 11:58:11 -08:00
Nikita Sobolev
d633bebbf9 Add a note that if sys.version_info is still required in test_cases (#9254) 2022-11-23 09:04:52 +00:00
Nikita Sobolev
ae58142e6e Fix typings of ExceptionGroup and BaseExceptionGroup (#9230)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2022-11-22 20:46:03 -08:00
Alex Waygood
1f8491d23d Allow adding test cases testing version-dependent Python features (#9238) 2022-11-21 08:03:28 -08:00
Nikita Sobolev
70c4af4b73 Refactor round and add tests (#9151)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-11-11 18:19:51 +00:00
Alex Waygood
4f381af4c5 Upgrade mypy to 0.990 (#9123) 2022-11-07 11:20:47 -08:00
Shantanu
00d3f8207a Add a test case for covariant asyncio.Task (#8833) 2022-10-03 15:17:49 -07:00
Alex Waygood
b53843ab46 Add infrastructure allowing for test cases for third-party stubs (#8700)
- Move the logic for running mypy on the test cases from `tests/mypy_test.py` to a separate script, `tests/regr_test.py`.
- Add the necessary logic in order to be able to have test cases for third-party stubs.
- Move logic common to `tests/mypy_test.py` and `tests/regr_test.py` into `tests/colors.py`, and rename `tests/colors.py` to `tests/utils.py`.
- Add a new check to `tests/check_consistent.py`, to enforce the use of `# pyright: reportUnnecessaryTypeIgnoreComment=true` comments in third-party test cases. These are essential if we want to have our tests against false-negatives work with pyright.
- Update the relevant documentation to account for the new test file.
- Add a new job to the `tests.yml` GitHub workflow, to run the new test in CI.
- Add a simple proof-of-concept test case for `requests`, as a regression test for #7998.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-09-08 16:51:33 +01:00
Alex Waygood
e2ef8fe116 test_cases README: Address post-merge review of #8688 (#8694)
Thanks @kkirsche for the review!
2022-09-06 17:00:57 +01:00
Alex Waygood
51e8325c10 Rename the files in the test_cases directory; add further clarifications to the README (#8688) 2022-09-06 07:50:24 +02:00
Alex Waygood
fd4feba2c9 Enable pyright's reportUnnecessaryTypeIgnoreComment setting for the whole test_cases directory (#8683) 2022-09-05 15:20:04 +02:00
Alex Waygood
8a326dc9ec Remove NoReturn overloads from pow() (#8568) 2022-08-19 11:15:07 -07:00
Alex Waygood
5b47f13a99 Add _threading_local.local.__delattr__ back to the stub (#8526) 2022-08-15 11:56:31 +02:00
Nikita Sobolev
d53d3258b2 Add "Naming convention" to test_cases/README.md (#8521)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-08-12 20:15:23 -07:00
Nikita Sobolev
510feeb3fc Improve constructor for builtins.dict (#8517)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-08-10 19:04:07 +01:00
Nikita Sobolev
266fed2f83 Consistent naming of files in the test_cases directory (#8520) 2022-08-10 10:33:42 +01:00
Alex Waygood
59a9621554 test_cases README: fix typos (#8453)
Both introduced in #8445
2022-07-31 23:11:13 +01:00
Alex Waygood
935ac9ca9e test_cases: Improve README (#8445) 2022-07-30 18:40:56 +01:00
Alex Waygood
e156c63bdb inspect, asyncio: Use more TypeGuards (#8057) 2022-07-18 19:49:12 -07:00
Alex Waygood
1ebe1b463e Fix asyncio.gather regression (#8271)
Adding the empty-tuple overload caused major problems for pyright, and that overload only deals with an unlikely edge case anyway. Get rid of it, and replace the fallback overload with a more general overload.

Fixes #8270.
2022-07-16 18:56:58 +01:00
Akuli
3c90c97b9a List[Foo] + List[Bar] now returns List[Foo | Bar] (#8293)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-15 20:20:50 +03:00
Alex Waygood
a1af16bda5 fractions.pyi: Correct dunder parameter names (#8285)
This wasn't possible prior to #8280, which disabled pyright's reportSelfClsParameterName check
2022-07-12 22:40:48 +01:00
Jelle Zijlstra
2a7439e106 Revert "add overload to tuple.__new__ to better express an empty tuple" (#8278)
This reverts commit 64554bdd5d.

Also add a test case.
2022-07-12 12:29:37 -07:00
Alex Waygood
27db37240a Remove files that only exist on <=3.6, update a few comments (#8273) 2022-07-12 09:12:32 +02:00
Alex Waygood
e19073e871 Add a tiny bit more special-casing for sum (#8231) 2022-07-02 20:05:56 +01:00
Alex Waygood
208d8e1ec2 Fix assertAlmostEqual regression on mixed numeric types (#8137) 2022-06-27 08:57:36 +02:00
Alex Waygood
538621e91b unittest.case: tighter annotations for various assertions (#8077) 2022-06-20 18:49:57 +02:00