according to this post, I can enumerate instance variable by accessing str(self.__dict__)
, but I can't figure out how to do that with class variables.
Here's what I want to AVOID:
# I would like to print out class attributes by overriding `__str__` for that class.
class circle(object):
radius = 3
def __str__(self): # I want to avoid instantiation like this.
return str(circle.radius)
print(circle()) # I want to avoid instantiation. why can't I just print(circle)?