[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2022-03-12 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2022-03-11 Thread Eric V. Smith
Eric V. Smith added the comment: I agree it's not worth fixing in 3.9 and 3.10. -- ___ Python tracker ___ ___ Python-bugs-list

[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2022-03-11 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: This is now fixed in main thanks to bpo-46644: ``` >>> get_type_hints(Foo) {'attr': dataclasses.InitVar[int]} ``` We're not backporting that change to the bugfix branches. If we want to fix this issue in 3.10 and 3.9, we'll have to add a `__call__` method

[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2022-01-21 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I think this should be fixed in typing.py instead. get_type_hints() should be less strict about what it accepts as a type, so users are free to use annotations in innovative ways. Static type checkers should have the job of enforcing that type annotations

[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2021-08-02 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2021-08-02 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2021-08-02 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 1.0 -> 2.0 pull_requests: +26060 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27553 ___ Python tracker

[issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar

2021-07-31 Thread Komiya Takeshi
New submission from Komiya Takeshi : I found `typing.get_type_hints()` raises TypeError for a variable annotated by `dataclasses.InitVar` when lazy annotations evaluation-feature is enabled (a.k.a `__future__.annotations`). ``` $ cat test.py from __future__ import annotations from