Commit Graph

6312 Commits

Author SHA1 Message Date
Graham Bleaney
8c434e05d6 Add PEP 675 LiteralString overloads to str class (#7725)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-31 21:09:34 -07:00
Lee
e8f20bbb56 markdown: add Markdown.registeredExtensions (#7997) 2022-05-31 14:10:30 +01:00
Shantanu
d736bb9d85 caldav: add verify_expand to Calendar.date_search (#7996)
Co-authored-by: hauntsaninja <>
2022-05-30 18:29:19 -07:00
Shantanu
bf68214245 mypy_primer: report lines truncated (#7993)
Co-authored-by: hauntsaninja <>
2022-05-30 17:04:34 -07:00
Alex Waygood
a7ff433fc3 CONTRIBUTING.md: Fix broken link (#7994) 2022-05-30 16:36:06 -07:00
Alex Waygood
fa85367fc9 CONTRIBUTING: improve docs on running tests locally (#7992)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-05-30 15:44:13 -07:00
Stephen Rosen
17e7cc7d3c Fix exception types for jsonschema._format (#7990)
The annotated type for the `raises` argument on format checkers was

    Exception | tuple[Exception, ...]

when it should read

    type[Exception] | tuple[type[Exception], ...]

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-05-30 17:14:33 +01:00
pranavrajpal
8f33ff9e9d Add __setstate__ for BaseException (#7987) 2022-05-30 11:33:55 +02:00
Jelle Zijlstra
1aa546d07d pyright: turn off reportPropertyTypeMismatch (#7985) 2022-05-30 09:20:28 +02:00
Chanwoo Yoon
92ba4b757f ujson: add JSONDecodeError (#7988) 2022-05-29 23:19:29 -07:00
Lee
8f7786c7df markdown: annotate Registry.__len__(). (#7986) 2022-05-30 02:10:07 +01:00
hamdanal
b151e0c5a7 Make usage in argparse.HelpFormatter._format_usage optional (#7983)
closes #7982
2022-05-29 15:21:20 -07:00
PIG208
5be7976fe3 psycopg2: Fix the return type of Composable.as_string (#7984)
Signed-off-by: Zixuan James Li <359101898@qq.com>
2022-05-29 15:15:56 -07:00
Stephen Rosen
b2aaed1e68 Fix jsonschema exception str|int containers (#7981)
schema_path, relative_schema_path, and absolute_schema_path are all
(related) attributes of `jsonschema` errors which contain `str | int`
but were accidentally annotated as containing `str`. Fix them for
accuracy.
2022-05-29 22:22:34 +01:00
David Robertson
ea16964d87 jsonschema: {relative,absolute}_path can hold ints (#7980) 2022-05-29 16:38:54 +01:00
Xavier Francisco
c94fb408b7 dj_database_url: make all keys optional in _DBConfig TypedDict (#7979)
Co-authored-by: Xavier Francisco <xavier.n.francisco@gmail.com>
2022-05-29 12:25:16 +01:00
Alex Waygood
d4eba8b5ce builtins.sum: Add overload for bool special case (#7975)
Closes #7974
2022-05-28 11:14:10 -07:00
Alex Waygood
8e8176b24c mypy_test.py: Skip Flask-SQLAlchemy (#7977) 2022-05-28 10:18:57 -07:00
Xavier Francisco
3191c1a2df Add stubs for dj-database-url (#7972)
Co-authored-by: Xavier Francisco <xavier.n.francisco@gmail.com>
2022-05-28 15:14:35 +01:00
Lee
1eef7365b9 markdown: remove __getattr__() (#7962) 2022-05-27 23:12:22 -07:00
Alex Waygood
ceccc655db Introduce _typeshed.GenericPath and _typeshed.AnyStr_co (#7970) 2022-05-27 19:02:00 +01:00
Stephen Rosen
f52da1e8b0 Flesh out more of jsonschema stubs (#7950)
Apply more detailed annotations to the format module and most of the
exceptions module.
2022-05-27 17:33:32 +01:00
Jelle Zijlstra
c35ec8ba89 contextlib: Remove explicit base class from ExitStack (#7963)
Fixes #7961
2022-05-27 09:19:18 -07:00
Xavier Francisco
2d2b34c1ee openpyxl: annotate openpyxl.utils.cell stubs (#7969) 2022-05-27 13:58:20 +01:00
Sebastian Rittau
d2728cf688 dateutil: Add dateutil.rrule.weekdays (#7968)
Closes: #7946
2022-05-27 11:15:03 +01:00
Crozzers
082faf0d29 Pillow: change _Mode type alias to str (#7967) 2022-05-27 11:16:41 +02:00
Alex Waygood
c05731c46f tempfile.pyi: readability improvements (#7959)
The name `_DirT` implies that it is a `TypeVar`, but it isn't; it's a generic `TypeAlias` that can be parameterised with a `TypeVar`. Rename it to just `_Dir` instead.

Also, use aliases instead of repeating incredibly long Literal annotations six times.
2022-05-27 08:52:44 +01:00
Jelle Zijlstra
7d34d75582 array: stub improvements (#7966)
- TypeVar changes from https://github.com/microsoft/pyright/issues/3501
- Fix pos-only param
- Use protocols instead of IO classes
2022-05-27 07:33:24 +01:00
Jelle Zijlstra
789c12ad90 constructors: Fix defaulted TypeVars (#7965)
From the list in https://github.com/microsoft/pyright/issues/3501
2022-05-27 07:32:56 +01:00
Crozzers
62a8a6922c Pillow: Add missing image modes to _Mode type alias in Image.pyi stub (issue #7956) (#7960) 2022-05-26 19:00:48 +01:00
Jelle Zijlstra
466f9c2ad7 redis: Fix unconstrained TypeVars in a few redis commands (#7942)
Part of #7928
2022-05-26 15:53:56 +01:00
Alex Waygood
d511312e21 multiprocessing.managers: fix TypeVar usage (#7938)
#7928

`dict()` and `list()` just return empty dictionaries and lists (respectively) if no arguments are supplied:

```python
>>> from multiprocessing.managers import SyncManager
>>> with SyncManager() as s:
...     print(s.dict())
...
{}
```
2022-05-26 07:18:43 -07:00
Alex Waygood
fa636bc044 Third-party stubs: fix several fictitious type aliases (#7958) 2022-05-26 06:26:26 -07:00
Lee
597be79b18 markdown: annotate __deprecated__ (#7955) 2022-05-26 07:23:59 +01:00
Jelle Zijlstra
84e2ea113f gettext: fix unconstrained TypeVar (#7935) 2022-05-26 07:10:47 +01:00
Akuli
f77d0f80a8 requests: allow immutable headers (#7932) 2022-05-25 20:22:05 -07:00
Alex Waygood
cb7742e12c tempfile: Fix TypeVar usage (#7939)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-25 20:06:46 -07:00
Shantanu
c8f9abf41d threading.Semaphore: add _value (#7952)
I've had occasion to use this multiple times. We already have _value for
asyncio.locks.Semaphore See also
https://github.com/python/cpython/issues/93213

Co-authored-by: hauntsaninja <>
2022-05-25 14:24:09 -07:00
Henry Schreiner
afb512f38b sre_parse.SubPattern.getwidth: return a tuple of ints (#7951) 2022-05-25 17:34:51 +01:00
Graham Bleaney
cb5b31cf15 Add LiteralString overloads to path module (#7727)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-25 08:52:52 -07:00
Alex Waygood
ac9efd8573 stubtest_stdlib: run on PRs updating requirements-tests.txt (#7949) 2022-05-25 15:29:05 +02:00
Sebastian Rittau
301caad709 Update mypy to 0.960 (#7948) 2022-05-25 14:44:22 +02:00
Jelle Zijlstra
d5bc48d29b builtins, collections: Fix unconstrained overloads for container constructors (#7944)
See https://github.com/microsoft/pyright/issues/3501#issuecomment-1135979479

Related to #7928
2022-05-25 10:07:23 +01:00
Jaakko Lappalainen
773ddb15bb Pillow: use union type for Image.paste (#7893) 2022-05-25 10:04:59 +01:00
Jelle Zijlstra
796a689fc1 mock: Fix unconstrained TypeVar (#7945)
The first overload covers the case where `new` is not given.

Part of #7928
2022-05-25 06:52:40 +01:00
Jelle Zijlstra
070e6c2a2d invoke: Fix unconstrained TypeVar (#7943)
Part of #7928 

f34c6c9413/invoke/tasks.py (L328)
2022-05-25 06:48:49 +01:00
Jelle Zijlstra
bb119544d8 pkg_resources: Fix unconstrained TypeVars (#7941)
499c468a57/pkg_resources/__init__.py (L1049)

Part of #7928
2022-05-24 19:49:22 -07:00
Alex Waygood
54e11a1ec4 mypy_extensions: fix TypeVar usage (#7937)
#7928
2022-05-24 11:26:35 -07:00
L
1e097a75cb markdown: Annotate methods of Registry (#7926)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-05-24 10:23:48 -07:00
Jelle Zijlstra
d950ec37ca fileinput: Fix TypeVar usage (#7934)
* fileinput: Fix TypeVar usage

Fixes #7922, part of #7928.
2022-05-24 17:55:35 +01:00