ymmx
ymmx

Reputation: 4967

__dict__ does not work for numba jitclass object

I'm trying to use jitclass from the numba module but when I'm trying to access to myclass.__dict__ I get an error saying:

{attributeerror} 'myclass' object has no attribute '__ dict __'.

Does there exist a solution to see what are the attributes in myclass?

Upvotes: 0

Views: 335

Answers (1)

asherbret
asherbret

Reputation: 6018

You can use dir to get all attributes of an object:

dir(myclass)

You can use hasattr to check if a certain attribute exists:

hasattr(myclass, "__dict__")

Upvotes: 1

Related Questions