Commit Graph

16 Commits

Author SHA1 Message Date
Alex Waygood 8e718d4891 pstats: delete outdated comment (#8738)
The annotation in CPython was fixed thanks to @ruancomelli in https://github.com/python/cpython/pull/96741!
2022-09-15 11:24:30 +01:00
Ruan Comelli 04a88d5740 pstats.FunctionProfile.ncalls should be str (#8712)
Correctly annotate `pstats.FunctionProfile.ncalls` as `str` instead of `int`.

Since this change introduces a difference between typeshed and CPython, add a comment pointing that out and linking to this PR.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-09-10 21:11:45 +01:00
Alex Waygood edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood 97a74bc1aa Import from collections.abc wherever possible (#7635) 2022-04-18 12:50:37 +02:00
Alex Waygood 740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood 3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Nikita Sobolev 9150db52a6 Improve pstats typing (#7174)
* Add __all__
* Use Literal for Stats.sort_stats() argument type.
* Add FunctionProfile, StatsProfile, and Stats.get_stats_profile() (Python 3.9+)
2022-02-11 12:30:00 +01:00
Shantanu b88a6f19cd Upgrade black version (#7089) 2022-01-30 16:27:06 -08:00
Alex Waygood 96c9abb058 Always use _typeshed.Self, where applicable (#6880)
* Always use `_typeshed.Self`, where applicable

* Revert changes to `google-cloud-ndb` (ambiguous)

* Remove empty line added by script

* Revert changes to `stubs/python-dateutil/dateutil/relativedelta.pyi`

* Manually add a few more that the script missed

* Improve `filelock` annotation

Source code here: https://github.com/tox-dev/py-filelock/blob/79ec7b2826e33b982fe83b057f359448b9d966ba/src/filelock/_api.py#L207

* Improve `opentracing/scope` annotation

Source code here: https://github.com/opentracing/opentracing-python/blob/3e1d357a348269ef54d67f761302fab93dbfc0f7/opentracing/scope.py#L71

* Improve `redis/client` stub

Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/client.py#L1217

* Improve `redis/lock` annotation

Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/lock.py#L155

* Improve `requests/models` annotation

Source code here: https://github.com/psf/requests/blob/d718e753834b84018014a23d663369ac27d1ab9c/requests/models.py#L653
2022-01-09 19:16:19 -08:00
Alex Waygood 8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Akuli 994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
Akuli ce11072dbe Big diff: use lower-case list and dict (#5888) 2021-08-08 09:26:35 -07:00
Akuli ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Sebastian Rittau f0bf6eebbd AnyStr cleanup (#5487)
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs.
* Add StrOrBytesPath as preferred alias for AnyPath.
* Replace all remaining AnyPath instances with StrOrBytesPath.
* Mark AnyPath as obsolete.

Part of #5470
2021-05-17 20:45:48 +02:00
Sebastian Rittau 6a9c89e928 Replace 'Text' with 'str' in py3 stdlib (#5466) 2021-05-16 07:10:48 -07:00
Ivan Levkivskyi 16ae4c6120 Re-organize directory structure (#4971)
See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-27 12:00:39 +00:00