Is it possible to check if an instance of a class has an attribute without (being able to) instantiating the class?
Example:
class A where I lack knowledge about arguments to instantiate:
class A:
def __init__(self, unkown):
self.a = 1
checking for attribute a in class A fails:
hasattr(A,'a')
>> False
checking for attribute a in instance of class A would succeed:
hasattr(A(1),'a')
>> True
Is it possible to check for attribute a without instantiating A? Maybe with something different than hasattr?
__dataclass_fields__.