conchylicultor <etiennefg....@gmail.com> added the comment:

Interestingly mypy, pylint correctly resolve the closure.

```
class A:
    dataclasses: dataclasses.Field = dataclasses.field()

A.dataclasses.other  # mypy error: "Field[Any]" has no attribute "other"
```

So the current workaround is to use quotes:

```
class A:
  # Type correctly inferred and no closure runtime error
  losses: 'losses.Losses' = losses.Losses()
```

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43746>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to