[Python-Dev] Postponed annotations break inspection of dataclasses

2018-09-22 Thread David Hagen
The new postponed annotations have an unexpected interaction with dataclasses. Namely, you cannot get the type hints of any of the data classes methods. For example, I have some code that inspects the type parameters of a class's `__init__` method. (The real use case is to provide a default serial

Re: [Python-Dev] Postponed annotations break inspection of dataclasses

2018-09-23 Thread David Hagen
On Sat, Sep 22, 2018 at 3:11 PM Guido van Rossum wrote: > Still, I wonder if there's a tweak possible of the globals and locals used when exec()'ing the function definitions in dataclasses.py, so that get_type_hints() gets the right globals for this use case. On Sat, Sep 22, 2018 at 4:38 PM Yury

Re: [Python-Dev] Postponed annotations break inspection of dataclasses

2018-09-23 Thread David Hagen
On Sat, Sep 22, 2018 at 12:41 PM Guido van Rossum wrote: > Probably a bugs.python.org issue is a better place to dive into the details than python-dev. Issue tracker issue created: https://bugs.python.org/issue34776 ___ Python-Dev mailing list Python-De