Related, `inspect.Parameter.annotation` is affected too, but at least this 
attribute is called `annotation` instead of `type`.

I noticed this today with `multipledispatch` (though 
[reported](https://github.com/mrocklin/multipledispatch/issues/104) in 2019) 
and some other internal code, both using `inspect.signature`. 
`multipledispatch` could reasonably swap to `typing.get_type_hints`, but the 
other code I was working with also used `Parameter.default` and 
`Parameter.kind`, so would require both `inspect.signature` and 
`get_type_hints`. Not the worst and arguably necessary now/pre PEP 563 with 
explicit string annotations, but the PEP 649 semantics would be a welcome 
improvement.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/RW7NUODC5YLSEXDNE4DBN6TGFGMGVF4L/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to