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'])
Related Contents:
- python: What happens when class attribute, instance attribute, and method all have the same name?
- Difference between @staticmethod and @classmethod
- Adding a Method to an Existing Object Instance
- TypeError: method() takes 1 positional argument but 2 were given
- Why do you need explicitly have the “self” argument in a Python method?
- Python: Bind an Unbound Method?
- 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
- Why does Python code use len() function instead of a length method?
- 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?
- Why doesn’t 2.__add__(3) work in Python?
- How do I access Class member variables in Python?
- Difference between methods and functions, in Python compared to C++
- Why do some functions have underscores “__” before and after the function name?
- What is a “method” in Python?
- Define a method outside of class definition?
- class variables is shared across all instances in python? [duplicate]
- Python __call__ special method practical example
- Python Method overriding, does signature matter?
- In Python, when should I use a function instead of a method?
- Why do I get a TypeError that says “takes no arguments (1 given)”? [duplicate]
- How to reload a module’s function in Python?
- How do I set and access attributes of a class? [duplicate]
- Adding a method to an existing object instance in Python
- “TypeError: method() takes 1 positional argument but 2 were given” but I only passed one
- How can I use an attribute of the instance as a default argument for a method? [duplicate]
- python: how to get information about a function?
- unbound method f() must be called with fibo_ instance as first argument (got classobj instance instead)
- class method generates “TypeError: … got multiple values for keyword argument …”
- Python Class Based Decorator with parameters that can decorate a method or a function
- call multiprocessing in class method Python
- Why does numpy have a corresponding function for many ndarray methods?
- How would I cross-reference a function generated by autodoc in Sphinx?
- Passing variables, creating instances, self, The mechanics and usage of classes: need explanation [closed]
- Python : Assert that variable is instance method?
- How to bind an unbound method without calling it?
- Split / Explode a column of dictionaries into separate columns with pandas
- How to “log in” to a website using Python’s Requests module?
- Calling a python script with input within a python script using subprocess
- Setting different color for each series in scatter plot on matplotlib
- Python Socket Receive Large Amount of Data
- Proper indentation for multiline strings?
- Python read JSON file and modify
- Load CSV data into MySQL in Python
- Namespaces with Module Imports
- Having both single and double quotation in a Python string