Every object has a __dict__
variable containing all the variables and its values in it.
Try this
>>> hi_obj = hi()
>>> hi_obj.__dict__.keys()
Output
dict_keys(['ii', 'kk'])
More Related Contents:
- python: What happens when class attribute, instance attribute, and method all have the same name?
- Adding a Method to an Existing Object Instance
- What is the difference between a function, an unbound method and a bound method?
- id()s of bound and unbound method objects — sometimes the same for different objects, sometimes different for the same object
- How to pass a default argument value of an instance member to a method?
- Safe method to get value of nested dictionary
- Is it possible to overload Python assignment?
- Inheritance of private and protected methods in Python
- Why don’t methods have reference equality?
- How do I access Class member variables in Python?
- class variables is shared across all instances in python? [duplicate]
- python: how to get information about a function?
- call multiprocessing in class method Python
- What are the parentheses for at the end of Python method names? [duplicate]
- What is a “method” in Python?
- What is a “callable” in Python?
- In Python, when should I use a function instead of a method?
- class method generates “TypeError: … got multiple values for keyword argument …”
- Adding a method to an existing object instance in Python
- How does a Python set([]) check if two objects are equal? What methods does an object need to define to customise this?
- Passing variables, creating instances, self, The mechanics and usage of classes: need explanation [closed]
- Python : Assert that variable is instance method?
- Calling one method from another within same class in Python
- Are functions objects in Python?
- Same name for classmethod and instancemethod
- Why does setattr fail on a bound method
- Why are python static/class method not callable?
- Why is a method not identical to itself?
- How do I call a method from another method?
- How to bind an unbound method without calling it?