-1

New to pdb and I am using p dir(a) to list all of the attributes of object a in my Django App. But I don't understand what the attributes such as '_class_', '_dict_' etc mean.

Shawn123
  • 437
  • 2
  • 5
  • 15

1 Answers1

0

These attributes have nothing to do with pdb, actually. They are built-in attributes of Python objects. For example, the __dict__ attribute is a dictionary of all the attributes the instance of a class has. You can find a more detailed explanation here. As for __class__, this is a reference to the class the instance has been spawned from. Again, a more detailed explanation can be found here.

Community
  • 1
  • 1
SivanBH
  • 392
  • 3
  • 13