Mega Code Archive

 
Categories / Python Tutorial / Buildin Function
 

Using dir to investigate a module

dir() on an  class instance shows the instance variables as well as the methods and  class attributes defined and all its base classes. dir() on a class shows the contents of the __dict__ of the class and all its base classes.  dir() on a module shows the contents of the module's __dict__.  dir() without arguments shows the caller's local variables.