How can we get the function pointer of the builtin print function in python.
It seems to behave differently than the other builtin functions:
>>> a = print
SyntaxError: invalid syntax
>>>> dir(print)
SyntaxError: invalid syntax
>>>> m = map
OK
>>>> dir(map)
['__call__', '__class__', [...] '__str__', '__subclasshook__']
You can't do this because print is a keyword in Python 2.7, so it would be along the lines of saying something like:
>>> a = if
Doesn't make too much sense.
You have two options.
Use python 3
Import the python equivalent: from __future__ import print_function