I intent to retrieve a list of default Built-in Functions specified in 2. Built-in Functions
How to list them all?
Just as list all the keywords as:
python
import keyword
keyword.kwlist
is it possible to list all the 68 functions?
This is my first question on SO, please note that it definitely not duplicate to the existing stuff on stackoverflow or even the world.
My question asked about the 68 builtin functions listed by docs which are absolutely different from dir(__builtins__):
enter image description here
asked Aug 6, 2017 at 4:36
Wizard
22.7k22 gold badges96 silver badges162 bronze badges
2 Answers 2
This will show all builtins:
>>> dir(__builtins__)
['ArithmeticError', 'AssertionError', ..., 'type', 'vars', 'zip']
answered Aug 6, 2017 at 4:40
Ignacio Vazquez-Abrams
804k160 gold badges1.4k silver badges1.4k bronze badges
Sign up to request clarification or add additional context in comments.
9 Comments
Ignacio Vazquez-Abrams
@cᴏʟᴅsᴘᴇᴇᴅ: Unfortunately I don't know quite every Python question on this site yet.
Tom Wojcik
If it's not a duplicate you may want to take a look at this.
Wizard
dir(builtins) list all the 151 builtin libraries nor to show the 68 functions. @IgnacioVazquez-Abrams
Wizard
the question did not duplicate, see my answer @cᴏʟᴅsᴘᴇᴇᴅ
coldspeed95
The exact same answer was present in the question I marked here. Duplicate answers are fine.
|
class BuiltinFunctions_42:
def __init__(self):
self.in = ['input']
self.file = ['open']
self.number = ['hex', 'oct', 'abs', 'round', 'divmod', 'pow', 'sum']
self.string = ['format', 'ord', 'chr', 'ascii', 'bin']
self.obj = ['id']
self.sequence = ['hash', 'len', 'max', 'min']
self.iterator = ['all', 'any','iter', 'next']
self.function = ['callable']
self.code = ['eval', 'exec', 'compile']
self.klass = ['__build_class__', 'issubclass']
self.instance = ['repr','isinstance', 'hasattr', 'getattr', 'setattr', 'delattr']
self.module = ['__import__']
self.dubug = {'introspection':{'locals', 'globals'}}
self.out = ['print', 'dir', 'vars']
answered Aug 7, 2017 at 4:58
Wizard
22.7k22 gold badges96 silver badges162 bronze badges
Comments
lang-py