Some python-2.7 and python-3.x functions have the same name, but perform differently. Can I import use a py2.7 function in python-3.x one, by changing its name?
The motivating example is python-2.7's "print", i.e. print "TEXT"
which does not use without parenthesis, compared to print("TEXT")
in python 3. Can I keep the python 2 "print" by binding it to something like pr
?
(By the way, the issue for me is typing and escaping the brackets. The keys (
and )
are harder to press than a space bar. Also, because my IDE puts them in automatically, I then need to move my cursor out of it.)
Note: I asked this previously, yet has been wrongly marked as a duplicate. Again, to be clear, I'm specifically asking if I can bind a python 2 function to a new name in order to use its functionality in python-3.x.
I do not know how to contact moderators via internal message or correct this wrongful flag.