A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-September/155293.html below:

[Python-Dev] Postponed annotations break inspection of dataclasses

[Python-Dev] Postponed annotations break inspection of dataclasses [Python-Dev] Postponed annotations break inspection of dataclassesYury Selivanov yselivanov.ml at gmail.com
Sat Sep 22 16:38:22 EDT 2018
On Sat, Sep 22, 2018 at 3:11 PM Guido van Rossum <guido at python.org> 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.
>
> It's really tough to be at the intersection of three PEPs...

If it's possible to fix exec() to accept any Mapping (not just dicts),
then we can create a proxy mapping for "Dataclass.__init__.__module__"
module and everything would work as expected.

Here's a very hack-ish fix we can use in meanwhile (even in 3.7.1?):
https://gist.github.com/1st1/37fdd3cc84cd65b9af3471b935b722df

Yury
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4