Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Python's dir() function stand for? [duplicate]

Tags:

python

I know that the dir() function gives you back either the names defined in the current scope or the names defined in an object. But why is it called dir()? Is it some mysterious acronyms like LISP's CAR and CDR?

like image 577
Y.H Wong Avatar asked Oct 08 '11 09:10

Y.H Wong


People also ask

What does dir () stand for in python?

The dir() function returns all properties and methods of the specified object, without the values. This function will return all the properties and methods, even built-in properties which are default for all object.

What are HELP () and dir () in python?

Help() and dir(), are the two functions that are reachable from the python interpreter. Both functions are utilized for observing the combine dump of build-in-function. These created functions in python are truly helpful for the efficient observation of the built-in system.

What is the use of dir?

Purpose: Displays directory of files and directories stored on disk. In addition to files and directories, DIR also displays both the volume name and amount of free storage space on the disk (if there are files stored in the current directory).


1 Answers

It gives you an alphabetical listing of valid names (attributes) in the scope (object). This is pretty much the meaning of the word directory in english.

like image 182
wim Avatar answered Sep 29 '22 14:09

wim