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 baskakov
Recipients baskakov
Date 2021-08-15.22:19:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629065975.65.0.328459121322.issue44922@roundup.psfhosted.org>
In-reply-to
Content
Hey I was trying to import dataclasses from another file and somehow isinstance doesn't work anymore:
main.py:
```
import codegen
from dataclasses import dataclass

@dataclass
class AtomX:
    my_symbol: str
    quantity: str = ""

codegen.inheritance_map(AtomX("qwerty"))

```
codegen.py:
```
from main import AtomX

def inheritance_map(candidate):
    assert isinstance(candidate, AtomX)
```

PS the same code with `assert candidate.__class__.__name__ == "AtomX"` works fine

----
Python 3.9.6 (v3.9.6:db3ff76da1, Jun 28 2021, 11:49:53) 
[Clang 6.0 (clang-600.0.57)] on darwin
I'm running inside of PyCharm
History
Date User Action Args
2021-08-15 22:19:35baskakovsetrecipients: + baskakov
2021-08-15 22:19:35baskakovsetmessageid: <1629065975.65.0.328459121322.issue44922@roundup.psfhosted.org>
2021-08-15 22:19:35baskakovlinkissue44922 messages
2021-08-15 22:19:35baskakovcreate