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

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


IIRC I named it after the DIR command in DOS.


It gives you a directory of all attributes of an object.

This is not a directory as used in file systems, but the standard usage: a listing of names or data.


You're retrieving a "directory", a list of all of the stuff that's available in some resource.