Commit Graph

4861 Commits

Author SHA1 Message Date
Steve Dignam
4ef07810c4 redis: include local property on Lock class (#6083)
The Lock class as a property local that has a token property that sometimes
needs be accessed / set.

```python
lock = redis.lock(key)
lock.local.token = token
lock.extend(10)
```

Technically the type of `local` is `SimpleNamespace | threading.local`
but I think this setup is a bit stricter but satisfies the API.
2021-09-28 21:16:23 -07:00
Nikita Sobolev
4ac969ad2c Fixes __init__ of typing.NamedTuple (#6080)
Closes #6079
2021-09-28 20:42:27 -07:00
Zac Hatfield-Dodds
7cc5eb2950 StackSummary.extract() takes an Iterable (#6084) 2021-09-28 09:24:54 +02:00
Vincent Pelletier
4c0dccac0f Fold remaining custom stdlib *Buffer types into _typeshed. (#6082)
Add ctypes base type to WriteableBuffer.
Add a ReadOnlyBuffer type from fcntl.
Base ReadableBuffer on WriteableBuffer and ReadOnlyBuffer.
Use these types in fcntl and ctypes stubs.
2021-09-28 09:15:26 +02:00
Ju4tCode
328d09a9a5 Fix error type for inspect Parameter/Signature empty (#6073) 2021-09-27 13:49:22 +02:00
Nikita Sobolev
b905dd2945 Specify concrete types for DateDataParser attributes (#6075) 2021-09-27 10:21:28 +02:00
cmckain
57c26d5b2c PageElement.find_all() can return any subclass of PageElement (#6081) 2021-09-27 09:54:40 +02:00
Nikita Sobolev
a9227ed985 Improves Popen types in psutil (#6074) 2021-09-25 12:42:05 -07:00
Nikita Sobolev
583aa16876 Further improvements to psutil (#6072)
Adds types to the following functions:
- `psutil.environ()`
- `psutil.send_signal()`
- `psutil.sensors_temperatures()`
- `psutil.sensors_fans()`
- `psutil.sensors_battery()`
2021-09-25 13:07:58 +03:00
Sebastian Rittau
3128c6afbf requests: Response.encoding can be None (#6067)
The type of the `encoding` attribute was previously typed as `str`, even though it can be `None` at runtime.
2021-09-25 11:50:36 +03:00
Nikita Sobolev
2217ac8a8c Further annotations for the psutil module (#6066) 2021-09-24 10:56:15 +02:00
Nikita Sobolev
3bc309daaa Adds AM_STR and PM_STR to locale.py (#6065) 2021-09-24 10:51:33 +02:00
Hackrrr
2237daa650 Update for beautifulsoup4 for version 4.10 (#6059)
Tighten types and add missing fields
2021-09-22 17:42:42 +02:00
Shantanu
67e8979ac1 stubtest_third_party: more newlines in printing (#6060)
Co-authored-by: hauntsaninja <>
2021-09-21 23:16:12 +02:00
Estelle Poulin
15cec1da8e Change Traversable to be inline with pathlib.Path (#5818)
`pathlib.Path` objects are now valid `importlib.abc.Traversable`s.
2021-09-21 21:36:10 +03:00
Matthew Hughes
d1a556cec9 Update Session.prepare_request, .get_adapter (#6058) 2021-09-21 19:15:45 +02:00
Gregory Oschwald
28eb7c8b4d Remove maxminddb stubs in favor of upstream (#6043) 2021-09-20 16:19:07 -07:00
Akuli
eb7b97ee78 Add types to Markdown (#6045)
Most methods and attributes were previously untyped or `Any`-typed.

Co-authored-by: PythonCoderAS <13932583+PythonCoderAS@users.noreply.github.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-09-20 18:39:53 +03:00
Edgar Ramírez
8ea6d6f331 Support name, content-type and headers in file upload (#6052)
`requests` supports not only passing binary file-like objects for multi-part file uploads but also additionally passing a name,  content-type and headers. This adds type hints for those options.

See https://docs.python-requests.org/en/master/user/quickstart/#post-a-multipart-encoded-file.
2021-09-20 06:46:22 -07:00
Sebastian Rittau
915feaceb6 maxminddb: Update version field and set obsolete_since (#6055) 2021-09-20 06:44:34 -07:00
Akuli
196f69b27e dict.__init__: support dict(string.split(sep) for string in iterable) (#6050) 2021-09-20 13:52:41 +02:00
Akuli
aff3e4d1c5 Create stubs for appdirs (#6047) 2021-09-20 13:20:06 +02:00
KotlinIsland
1b5c4e1d57 Add support for dict.{keys,values,items}.mapping (#6039)
Co-authored-by: KotlinIsland <kotlinisland@users.noreply.github.com>
2021-09-19 22:30:14 -07:00
Akuli
75c75a093e ttkthemes: allow constructing ThemedStyle with no arguments (#6046) 2021-09-19 15:11:08 -07:00
Akuli
7ed8da4415 Create stubs for toposort (#6048) 2021-09-19 14:04:23 -07:00
Akuli
afad78343a change prints in scripts/create_baseline_stubs.py (#6051) 2021-09-19 12:38:23 -07:00
Anton Grübel
caa642dd3b improve typing in inspect (#6020) 2021-09-18 20:11:55 -07:00
Sebastian Rittau
0506182348 Allow three-component third-party versions (#5995)
Closes: #5992
2021-09-18 20:08:51 -07:00
Sebastian Rittau
d7bae50199 Update third-party package versions (#5996) 2021-09-18 20:08:38 -07:00
Sebastian Rittau
aa4a0c763a Fix distribution name backports.ssl_match_hostname (#5997)
Bump version number to latest version available on pypi

Turn backports.ssl_match_hostname into a package to match upstream
2021-09-18 20:08:21 -07:00
Sebastian Rittau
db69e41fda Add setuptools stubs (#5762) 2021-09-18 19:45:23 -07:00
Rebecca Chen
d74a5a9ef8 Add undocumented attribute multiprocessing.process.BaseProcess._identity (#6041)
A user filed an issue against pytype about this attribute being missing:
https://github.com/google/pytype/issues/1010. I determined its type from
the source code:
https://github.com/python/cpython/blob/3.9/Lib/multiprocessing/process.py.
2021-09-17 13:14:07 -07:00
SupImDos
e4c2c0f302 Add SysLogHandler.address attribute (#6037) 2021-09-14 13:58:02 +02:00
Bas van Beek
a1ca55037a Update the xxhash and hashlib stubs (#6031)
* `name`, `block_size`, `digest_size` and `digestsize` attributes of hash objects were made read-only.
* It is now a type-checking error to subclass `xxhash` classes, such as `xxhash.xxh32`. Previously it was an error only at runtime.
* `xxhash` functions now accept strings as input and any object with `__index__()` method for `seed` (instead of requiring an integer). They also fail the type checking if no arguments are given.
2021-09-14 12:01:11 +03:00
Sebastian Rittau
ca38856670 Fix set annotations in concurrent.futures._base (#6034) 2021-09-14 11:50:20 +03:00
Sebastian Rittau
b562d233ae (a)next only requires __(a)next__, not Iterator (#6036) 2021-09-14 11:43:21 +03:00
Sam Martin
8a704ab290 Add more annotations to aws_xray_sdk.core.recorder (#6029) 2021-09-13 14:05:47 +02:00
Screwtapello
4c6e98ed0c Add many missing tkinter type annotations (#6002)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-09-12 11:42:12 +03:00
Shantanu
8576b344b8 binhex: removed in py311 (#6011) 2021-09-10 15:27:24 -07:00
Shantanu
c74fd22931 Update pytype (#6026)
Co-authored-by: hauntsaninja <>
2021-09-11 01:11:05 +03:00
Sander
7bfdacb4c4 stdlib/logging use object over Any for parameter types (#6025) 2021-09-10 16:04:32 +02:00
Akuli
e69ca588ac Stubs for ttkthemes (#6024) 2021-09-10 15:59:12 +02:00
Nikita Sobolev
392c81d767 Switch from toml to tomli (#6023) 2021-09-10 15:48:15 +02:00
Nikita Sobolev
7d41e670ad Annotate more NamedTuples for psutil (#6021) 2021-09-10 14:14:36 +02:00
Jungkook Park
18d4868fce Fix type of blocking_timeout argument to redis.lock.Lock (#6019) 2021-09-10 04:27:05 +02:00
Sebastian Rittau
9295c70ec0 'module' argument to ForwardRef.__init__() added in Python 3.9.7 (#6017)
Pin Python 3.9.7 for stubtest and update 3.10.0 to rc2
2021-09-10 01:10:28 +02:00
Nikita Sobolev
6122b5e8b4 Annotate several NamedTuples in psutil (#6016) 2021-09-09 22:37:00 +02:00
Nikita Sobolev
2a6f4afc80 Annotate more methods of psutil.Process (#6012) 2021-09-09 21:30:56 +02:00
Sebastian Rittau
2f3964e24b Return ItemsView/KeysView from Mapping methods (#6014)
* Return ItemsView/KeysView from Mapping methods

* Make RawConfigParser compatible with Mapping
2021-09-09 07:37:26 -07:00
Bas van Beek
b9e1d7d522 Replace Mapping with types.MappingProxyType (#6013)
Mark `Signature.parameters` and `.return_annotation` as read-only properties
2021-09-09 09:58:53 +02:00