[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

[issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value

2021-02-03 Thread Komiya Takeshi
Komiya Takeshi added the comment: FWIW, I succeeded to inspect the class with importing the constant from the base module as a workaround: ``` import inspect import io from io import DEFAULT_BUFFER_SIZE class MyBufferedReader(io.BufferedReader): """buff

[issue43118] inspect.signature() raises RuntimeError on failed to resolve the default argument value

2021-02-03 Thread Komiya Takeshi
New submission from Komiya Takeshi : inspect.signature() raises RuntimeError on failed to resolve the default argument value. For example, it fails to inspect a subclass of io.BufferedReader: Example: ``` import inspect import io class MyBufferedReader(io.BufferedReader): "&qu

[issue42288] typing.get_type_hints() returns Optional[Any] if the default value of the argument is None

2020-11-10 Thread Komiya Takeshi
Komiya Takeshi added the comment: Wow, I don't know that behavior. Thank you for your wisdom! -- ___ Python tracker <https://bugs.python.org/issue42288> ___ ___

[issue42288] typing.get_type_hints() returns Optional[Any] if the default value of the argument is None

2020-11-07 Thread Komiya Takeshi
New submission from Komiya Takeshi : I noticed `typing.get_type_hints()` returns Optional[Any] as a type hints if the default value of the argument is None: ``` $ python Python 3.9.0 (default, Oct 24 2020, 15:41:29) [Clang 11.0.3 (clang-1103.0.32.59)] on darwin Type "help",