Message412149
Wow! Thanks, that's an interesting find. My hunch is that we should be passing in _typevar_types and _paramspec_tvars in the copy_with of _GenericAlias and _ConcatenateGenericAlias. Inconsistent copy_with could trigger subtle bugs in ForwardRefs and get_type_hints. I can reproduce a semi-bug right now:
>>> P = ParamSpec('P')
>>> Callable[P, int].__parameters__
(~P,)
>>> Callable[P, int].copy_with((P,int))
typing.Callable[~P, int]
>>> Callable[P, int].copy_with((P,int)).__parameters__
()
^ This shouldn't be empty!!
Would you like to submit a patch for this? |
|
| Date |
User |
Action |
Args |
| 2022-01-30 14:44:34 | kj | set | recipients:
+ kj, gvanrossum, posita, sobolevn |
| 2022-01-30 14:44:34 | kj | set | messageid: <[email protected]> |
| 2022-01-30 14:44:34 | kj | link | issue46581 messages |
| 2022-01-30 14:44:34 | kj | create | |
|