I strongly dislike Python 3
Stephen Hansen
me+list/python at ixokai.io
Sat Jun 26 21:42:39 EDT 2010
On 6/26/10 6:24 PM, Steven D'Aprano wrote:
> On Sun, 27 Jun 2010 03:38:30 +1000, Lie Ryan wrote:
>> All in all, the new syntax requires 4 keystrokes, none of which are home
>> keys; compared with old syntax which requires 1 keystroke in thumb's
>> home position.
>>
>> Producing print function takes a little bit more effort than producing a
>> print statement.
>
>
> Worrying about this sort of micro-optimisation is hardly a productive use
> of anyone's time. Nobody here is complaining that typing len(x) requires
> three extra keystrokes compared to len x and therefore Python should make
> len a statement. Why should print be any different?
I swear I've heard a "it should be x.len" argument once where saving a
character was a key selling point (in addition to some vague
OOP-handwaving thing which indicated that it would also be Clearly The
Correct Thing To Do Anyways).
Just because no one is complaining about that *right now* doesn't mean
they won't -- and now you had to go and remind them of it. :)
Just saying.
As for the keystroke count -- pssh, my editor has me do 'print<tab>' and
it not only puts both the open and closing parens, but also moves my
cursor in between them. That's exactly the same effort as old-print! :)
> (1) The main use-cases for print are quick (and usually dirty) scripts,
> interactive use, and as a debugging aid. So this change isn't going to
> effect many large code bases, but mostly small scripts that can be fairly
> easily changed by hand.
I got called (essentially) elitist and condescending for thinking that
was basically the only places anyone really used print. Careful there. :)
> (4) Despite what the OP says, the ability to overload print is not a
> small feature, it is a major win. My scripts are filled with ugly
> functions pr(), print_() or prnt(), depending on how I was feeling at the
> time, none of which *quite* match the behaviour of the print statement
> correctly. The ability to redefine print in Python 3 is, to me, the
> Killer App for simple scripting:
>
[snip]
>
> The ability to make print() understand your script's --verbose flag is,
> in my mind, the most underrated plus for Python 3.
Interestingly enough, the reason I never use print is because its a
statement and is inflexible in this regard. If it were always a
function, I imagine my opinion of print's usefulness would be very
different today: I too have a number of slightly unique little
pseudo-print functions scattered throughout my codebase. That, and
various hacks replacing sys.stdout.
The rigidness of the statements behavior (and therefore inability to
bend it to my whim) is why I always just equated it with temporary or
quick and dirty usage.
--
... Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT) io
... Blog: http://meh.ixokai.io/
More information about the Python-list
mailing list