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
Alex Waygood
5fa31e6759
Remove mypy error codes from the test_cases directory ( #8083 )
2022-06-15 15:31:45 +01:00
Alex Waygood
5add91d6bb
unittest: Improve self.assert(Not)AlmostEqual(s) (#8066 )
2022-06-14 18:24:51 +03:00
Alex Waygood
1828ba2045
builtins.sum: Items in the iterable must support addition with int if no start value is given (#8000 )
2022-06-13 11:25:38 +01:00
Alex Waygood
1aa5663f9e
Add __setattr__ to logging.LogRecord ( #8064 )
2022-06-12 12:04:22 -07:00
Sebastian Rittau
214bf15dce
Use "all +=" instead of duplicating the branches ( #7865 )
2022-06-07 13:32:19 +02:00
Jelle Zijlstra
c35ec8ba89
contextlib: Remove explicit base class from ExitStack ( #7963 )
...
Fixes #7961
2022-05-27 09:19:18 -07:00
Jelle Zijlstra
9660ee97ee
codecs: add missing function, reflect runtime import * ( #7918 )
2022-05-22 16:06:21 -07:00
Shantanu
032787d867
builtins: accept old-style iterables to iter ( #7817 )
2022-05-10 09:06:31 +02:00
Alex Waygood
bb39bdfd30
Add test cases for pow that are meant to fail a type check ( #7760 )
2022-05-08 08:16:37 -07:00
Alex Waygood
c3ebc7e307
More improvements to pow stubs ( #7737 )
2022-04-28 10:49:29 -06:00
Jelle Zijlstra
02e0c98d62
Buffer support for re ( #7679 )
2022-04-23 18:28:35 -07:00
Alex Waygood
2773480d13
Add regression tests for builtins.pow and object.__reduce__ ( #7663 )
2022-04-21 21:17:37 -07:00