bpo-44799: Fix InitVar resolving using get_type_hints#27553
bpo-44799: Fix InitVar resolving using get_type_hints#27553uriyyo wants to merge 1 commit intopython:mainfrom
Conversation
| def __init__(self, type): | ||
| self.type = type | ||
|
|
||
| def __call__(self, *args, **kwargs): # required by typing.get_type_hints, see bpo-44799 |
There was a problem hiding this comment.
How does this solve the problem at hand?
I'm unlikely to accept any changes to dataclasses and typing until PEP 649 is ruled on.
There was a problem hiding this comment.
Exception raised by _type_check. In case if object is callable this object won't raise exception.
Lines 180 to 181 in e06ae75
I found that it was the easiest way to solve this issue. If you think it's a bad solution I am open to fix it in another way.
There was a problem hiding this comment.
It just seems like it's papering over some actual problem.
In any event, I'm waiting on PEP 649, which if accepted makes this whole point moot.
There was a problem hiding this comment.
Makes sense, will wait on a update regarding PEP 649.
|
This PR is stale because it has been open for 30 days with no activity. |
|
Thanks for your contribution! bpo-46644 fixed this issue for 3.11, and we decided not to fix it in 3.9 or 3.10. |
https://bugs.python.org/issue44799