This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author slebedev
Recipients AlexWaygood, aidan.b.clark, eric.smith, gvanrossum, kj, slebedev, sobolevn
Date 2021-10-22.18:48:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634928533.16.0.152039380843.issue45524@roundup.psfhosted.org>
In-reply-to
Content
Is it worth also addressing the case where a @dataclass/typing.TypeDict class is defined within a function?

```                                                                                                  
from __future__ import annotations

import typing
from dataclasses import dataclass


def make_A():
  import collections

  @dataclass
  class A:
    x: collections.defaultdict

  return A


A = make_A()

@dataclass
class B(A):
  y: int

# NameError: name 'collections' is not defined
print(typing.get_type_hints(B.__init__))
```
History
Date User Action Args
2021-10-22 18:48:53slebedevsetrecipients: + slebedev, gvanrossum, eric.smith, sobolevn, kj, AlexWaygood, aidan.b.clark
2021-10-22 18:48:53slebedevsetmessageid: <1634928533.16.0.152039380843.issue45524@roundup.psfhosted.org>
2021-10-22 18:48:53slebedevlinkissue45524 messages
2021-10-22 18:48:53slebedevcreate