Commit Graph
16 Commits
Author SHA1 Message Date
Jon Dufresne b03cd49a87 Type optparse.Option.default attribute (#5080)
https://github.com/python/cpython/blob/1e3c68246ee738b5ec5450b1eb39af2fca300cb9/Lib/optparse.py#L458
2021-02-28 09:15:38 -08:00
Jon Dufresne c6ede41cd0 Correct and update several optparse types (#4897)
The first positional argument to HelpFormatter.format_option() and
HelpFormatter.format_option_strings() is a Option instance, not an
OptionParser.

Added some attributes to the Option class:

- callback
- callback_args
- callback_kwargs
- help
- metavar

The OptionParser.option_groups attribute is a list of OptionGroup
instances, not OptionParser instances.

The method OptionParser.add_option_group() returns a OptionGroup
instance (the one created/added), not an OptionParser instance.
2021-01-04 15:54:55 +01:00
Jon Dufresne 61c61d2db4 Precise return type of HelpFormatter.format_option_strings() (#4896)
Always returns a str:
https://github.com/python/cpython/blob/v3.9.1/Lib/optparse.py#L366
2021-01-03 16:07:12 -08:00
Jon Dufresne 2cb6b14834 Add type for distutils.command.install.SCHEME_KEYS (#4863) 2020-12-27 19:54:43 +01:00
Jon Dufresne dc80863254 Update isort URL to new location: https://github.com/PyCQA/isort (#4841) 2020-12-19 22:15:09 -05:00
Jon Dufresne 3ae99d153b Allow Python 2 unicode for some click interfaces (#4825)
Helps Python 2 code using:

    form __future__ import unicode_literals

On Python 2, these interfaces are compatible with both str and unicode.
2020-12-15 20:51:43 +01:00
Jon Dufresne 66c3945ca4 Remove certifi.old_where (#3436)
The function was removed from the API in commit (Nov 26, 2018):

https://github.com/certifi/python-certifi/commit/a462d21c3f491635ed11a6aaa4e2022d1ca4cace
2019-11-03 18:26:43 +01:00
Jon Dufresne 0ee7c3c38b Update __import__ function annotations (#3188)
Per the docs, globals/locals is an optional argument.
Additionally, globals/locals can be any mapping type, not only a dict.
Likewise, fromlist can be any sequence (the docs mention a tuple, not a
list).
The function returns a ModuleType, not Any.
2019-08-16 11:03:00 +02:00
Jon Dufresne 679e1a9a8c Update URL: python/black → psf/black (#3180) 2019-08-10 13:31:58 -07:00
Jon Dufresne 02401c836f Add type annotations for Python 3 html.entities (#3161) 2019-07-31 15:46:16 +02:00
Jon Dufresne f2fdb54765 Precise the type of Python 2 htmlentitydefs module (#3163)
The code and documentation specifies the values specifically as
dictionaries.
2019-07-31 15:45:50 +02:00
Jon Dufresne edee7cfb3c Remove unused import from stdlib/2/htmlentitydefs.pyi (#3162) 2019-07-31 09:06:02 +02:00
Jon Dufresne 910c71050d Update Black URL (#2950) 2019-05-04 11:42:44 -04:00
Jon Dufresne 47f22a341e Add def __getattr__(name) -> Any: ... to all docutils stubs (#2439)
The stubs are very incomplete causing false positive when used. Add a
fallback to until they can become more complete.
2018-09-13 21:59:13 +02:00
Jon Dufresne 2b022d18a4 Add stub for unittest.mock (#731)
Stub generated by stubgen.

Fixes #372
2016-12-07 08:05:01 -08:00
Jon Dufresne 4b369945d0 Change struct fmt argument to str instead of AnyStr (#669)
Switching between a bytes fmt and str fmt argument can cause a BytesWarning
when running Python with the -b command line argument.
2016-11-07 16:58:25 -08:00