According to https://docs.python.org/3/library/functions.html,
the "built-in function" means a python-innate function such as print or sum.
However, type(numpy.array) results in builtin_function_or_method even though the numpy module is not python-innate.
Why does it happen?
Because builtin_function_or_method is not really testing if it is a built in (which is rather a bit ambiguous term). Rather, it tests if a function or method was written in C.
From the official document:
types.BuiltinFunctionType
types.BuiltinMethodType
The type of built-in functions like len() or sys.exit(), and methods of built-in classes. (Here, the term “built-in” means “written in C”.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With