Closed
Description
Hi,
It seems that two fields in inspect.FullArgSpec
are mis-annotated:
Looking at the implementation of getfullargspec
, at the very end this happens:
if not kwdefaults:
# compatibility with 'func.__kwdefaults__'
kwdefaults = None
if not defaults:
# compatibility with 'func.__defaults__'
defaults = None
The two fields kwonlydefaults
and defaults
need to be Optional[]
. This seems to be true for Python 3.4+:
- https://github.com/python/cpython/blob/3.4/Lib/inspect.py
- https://github.com/python/cpython/blob/3.5/Lib/inspect.py
- https://github.com/python/cpython/blob/3.6/Lib/inspect.py
- https://github.com/python/cpython/blob/3.7/Lib/inspect.py
- https://github.com/python/cpython/blob/3.8/Lib/inspect.py