What’s the biggest difference between dir() and __dict__ in Python
dir() does much more than look up __dict__ First of all, dir() is a API method that knows how to use attributes like __dict__ to look up attributes of an object. Not all objects have a __dict__ attribute though. For example, if you were to add a __slots__ attribute to your custom class, instances of … Read more