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 <>
Hey I was trying to import dataclasses from another file and somehow isinstance doesn't work anymore:
import codegen
from dataclasses import dataclass

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


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
Date User Action Args
2021-08-15 22:19:35baskakovsetrecipients: + baskakov
2021-08-15 22:19:35baskakovsetmessageid: <>
2021-08-15 22:19:35baskakovlinkissue44922 messages
2021-08-15 22:19:35baskakovcreate