21 juin 2021 · dir () tries to return a valid list of attributes of the object it is called upon. Also, dir () function behaves rather differently with different type of objects, as it aims to produce the most relevant one, rather than the complete information. For Class Objects, it returns a list of names of all the valid attributes and base attributes as.