[Python-ideas] A suggestion for Python 3 vs Python 2
Xuancong Wang
xuancong84 at gmail.com
Tue Nov 12 04:45:30 CET 2013
Hi python developers,
I notice that one major change in python 3 is that it makes 'print' as a
standard function, and it will require typing (). I do understand that it
makes python language more consistent because most of the python
functionalities are implemented as function calls.
As you know, reading from and writing to IO is a high frequency operation.
By entropy coding theorem (e.g. Huffman coding), an efficient language
should assign shorter language code to more frequent tasks. Typing a '('
requires holding SHIFT and pressing 9, the input effort is much higher than
that in Python 2. Also, specifying IO has changed from >>* to file=*, which
also becomes more inconvenient.
I hope you we can take a look at user's code and see what are the most
commonly used functions and try to shorten the language codes for those
functions. Assigning shortest language codes to most frequently used
functions will make python the best programming language in the world.
What I suggest is that either we can treat those most common functions like
print as a special command to avoid typing (), or we add alias to these
most common functions, so that if the user types:
print >>fp1, 'hello world'
Internally, it is equivalent to calling function print('hello world',
file=fp1)
Another suggestion is that 'enumerate' is also frequently used, hopefully
we can shorten the command as well.
Any comments?
Wang Xuancong
National University of Singapore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131112/bb12b3f8/attachment.html>
More information about the Python-ideas
mailing list