Lompat ke konten Lompat ke sidebar Lompat ke footer

Python Get Class Attributes - How Do I See The Attributes Of A Class In Python?

  1. To get the list of all the attributes, methods along with some inherited magic methods of a class, we use a built-in called dir().
  2. Another way of finding a list of attributes is by using the module inspect.
  3. To find attributes we can also use magic method __dict__.
  4. To find attributes we can also use vars() function.

Posting Komentar untuk "Python Get Class Attributes - How Do I See The Attributes Of A Class In Python?"