[Python-ideas] A suggestion for Python 3 vs Python 2

Xuancong Wang xuancong84 at gmail.com
Tue Nov 12 06:03:40 CET 2013


>An interesting methodology; however, I think PERL already has
>conquered this corner of the language world.

I think Perl has much lower efficiency than python, especially you need to
type a $ before every variable. The input effort of $ is very high because
you need to press shift.

Also, you need to type {} for every function/for/while structure.

In terms of language efficiency, I think Perl is no comparison to Python.

We can roughly estimate the input effort of every key in the following way:
Normal alphabet keys: effort=1
Numbers 0~9: effort=1.2
Shift/Tab: effort=0.6
Ctrl/Alt: effort=0.8
{}[];'\,./-=: effort=1.2
(effort measures how difficult it is to press the key)
Therefore, any composed keys like shift+9='(',  the input effort is
0.6+1.2=1.8
that's why we should try to avoid composed keys if it's not necessary.

>>"Advantages of print being a function:
* You can override it. Can't do that with a special language element.
* It can be used in map, lambda, and other expression contexts.
* Precedence etc follows the normal rules of functions - the arguments
are all tidily enclosed.
* Keyword arguments, rather than magical syntax, handle the oddities
like end=" ".
* You can easily alias it: "p = print; p('Hello, world!')"

I do agree that print should remain as a function logically. But is there a
way to make it as simple as in python 2, or even simpler, for example:
pr >>sys.stderr, 'hello world'

xuancong


On Tue, Nov 12, 2013 at 11:56 AM, Mark Janssen <dreamingforward at gmail.com>wrote:

> On Mon, Nov 11, 2013 at 7:45 PM, Xuancong Wang <xuancong84 at gmail.com>
> wrote:
> > 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.
>
> An interesting methodology; however, I think PERL already has
> conquered this corner of the language world.
> --
> MarkJ
> Tacoma, Washington
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131112/2563dea6/attachment.html>


More information about the Python-ideas mailing list