Message 404812 - Python tracker
Message404812
| 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:53 | slebedev | set | recipients: + slebedev, gvanrossum, eric.smith, sobolevn, kj, AlexWaygood, aidan.b.clark |
| 2021-10-22 18:48:53 | slebedev | set | messageid: <1634928533.16.0.152039380843.issue45524@roundup.psfhosted.org> |
| 2021-10-22 18:48:53 | slebedev | link | issue45524 messages |
| 2021-10-22 18:48:53 | slebedev | create | |