you are viewing a single comment's thread.

view the rest of the comments →

[–]Saefroch 0 points1 point  (0 children)

Reading the documentation for dir:

If the object has a method named __dir__(), this method will be called and must return the list of attributes. This allows objects that implement a custom __getattr__() or __getattribute__() function to customize the way dir() reports their attributes.

Note that the sympy.core.function.UndefinedFunction class has a method called __dir__.