Why is 'dir()' named 'dir' in python?

TM. picture TM. · Dec 3, 2009 · Viewed 7.6k times · Source

In Python there is a built-in function called dir. This is used to get a list of all the attributes for an object.

I understand what it does, but I am confused about why it is called dir. How is this name related to getting the attributes from an object?

Answer

Guido van Rossum picture Guido van Rossum · Feb 21, 2018

IIRC I named it after the DIR command in DOS.