From: Laurent Verweijen on
Since I was relatively new to python when python 3 was released (I'm
using it since python 2.5) I don't really care about the print
statement. Making print a function makes print less an exception since
all other functions need brackets.
I also like most of the other changes in python 3 like float division
and making range an iterator.

Something I really dislike, is that the "__cmp__"-method is gone.
I really hate to write 6 different functions, whereas I'm used to
writing a oneliners which covers each of the 6 cases.
I haven't switched to pyton 3 yet, but when I do, I will give my classes
a single compare method and omit the syntactic sugar.

Somelauw

On Sat, 2010-06-26 at 17:59 +0200, Stefan Reich wrote:
> Hi there.
>
> Let me preface this by saying that I am a fan of Python. I use it
> regularly and I like it a lot.
>
> That is, I am using and liking Python 2.6.
>
> I don't like Python 3.
>
> I won't comment on the advanced stuff that is changed in Python 3, as I
> haven't look into that.
>
> My complaint is about changing the syntax of "print".
>
> This has probably been talked about on your lists, but I wasn't part of
> that discussion. And I think that everyone has a right to bring up a
> subject at any time if it is still important. And I believe it is
> because Python 3 is out there and it poses a real problem.
>
> The main problem is that Python 3 is incompatible with almost all
> scripts written for Python 2 (if they use print). And it gets worse:
> Python 3 scripts are incompatible with Python 2! (If they use print
> variants, like writing to a file.)
>
> Thus the world of Python scripts is split in two incompatible factions.
> All for simplifying the syntax of one statement. That, to me, is pure
> insanity.
>
> Here's the advantages:
>
> -Some arcane stuff like redefining "print" in a module (which 99% of
> users will never do) allegedly gets easier.
> -Any more?
>
> And here's the disadvantages:
>
> -The Python 3 syntax actually requires more keystrokes.
> -Python world split in half. There is now a Python 2 world and a Python
> 3 world, both incompatible with each other.
> -Libraries written for Python 2 cannot be mixed with libraries written
> for Python 3.
> -Developers have to choose between Python 2 and Python 3 and are bound
> to their choice afterwards.
>
> So there are basically no advantages and extremely significant
> disadvantages. The single advantage there is could certainly be achieved
> without breaking all scripts out there.
>
> Consider Java as a better example: JDK 1.6 still runs and compiles
> everything written for JDK 1.0. That is proper management. Python 3 is,
> I'm sorry to say, an example of unfathomably bad management.
>
> To reiterate, I am strongly in disfavor of Python 3 and will stick to
> Python 2, for as least as long as Python 3 breaks my scripts.
>
> Cheers,
> Stefan


From: Terry Reedy on
On 6/26/2010 2:55 PM, Peter Kleiweg wrote:

PSF is funding work on the email module. Problems with cgi and other
internet interfacing modules are the main topic of discussion on py-dev
this week.

> Some basic text string functions seem to be working on byte
> string functions as well, but sometimes they don't, and there's
> no rhyme in why it does or doesn't.
>
> >>> 'abcd'[0] == 'abcd'[:1]
> True
> >>> b'abcd'[0] == b'abcd'[:1]
> False
>
> Why????

The bytes behavior is the normal behavior for sequences. Indexing
produces an element of the sequence (in this case an int) while slicing
produce a subseqeunce of the sequence, which is different from an
element of the sequence. Try the same with tuples, lists, and ranges.

Strings are anomalous in that indexing produces a subsequence instead of
an element (char in this case, which Guido chose for Python not to have).
--
Terry Jan Reedy

From: Terry Reedy on
On 6/26/2010 11:59 AM, Stefan Reich wrote:

> I don't like Python 3.

I love it.

> My complaint is about changing the syntax of "print".

Having completely switched from 'printf(' to 'print ', I have had a bit
of a problem switching back to 'print('. It is my single largest source
of typos. But a decent system that puts me at the site of syntax errors
alleviates this. Logic bugs are a much bigger problem.

Nonetheless, I support the switch. Not just for the symmetry with
input(), but because it properly is a function. And I really prefer
print('xyz', file=myfile), which I do use, to the ugly >>myfile hack.

[snip]
> To reiterate, I am strongly in disfavor of Python 3 and will stick to
> Python 2, for as least as long as Python 3 breaks my scripts.

Although I an not using 2.x currently, I am one of the people who
suggested and supported the idea of fixing bugs for 2.7 for several
years. I hope it someday becomes a polished jewel with essentially no
bugs. I expect it to be used a long time.

On the other hand, I strongly feel Python3 is better for student just
learning to program who do not need 2.x libraries.

--
Terry Jan Reedy

From: Paul Rubin on
Terry Reedy <tjreedy(a)udel.edu> writes:
> Having completely switched from 'printf(' to 'print ', I have had a
> bit of a problem switching back to 'print('. It is my single largest
> source of typos. But a decent system that puts me at the site of
> syntax errors alleviates this. Logic bugs are a much bigger problem.

I tend to print a lot of tracing messages in my programs, in the form

print (x, y, z)

expecting to print the tuple (x,y,z) in a form that I can read back
into an analysis program. That's going to break without throwing
any syntax errors if I ever switch to Python 3.
From: Terry Reedy on
On 6/26/2010 8:02 PM, Paul Rubin wrote:
> Terry Reedy<tjreedy(a)udel.edu> writes:
>> Having completely switched from 'printf(' to 'print ', I have had a
>> bit of a problem switching back to 'print('. It is my single largest
>> source of typos. But a decent system that puts me at the site of
>> syntax errors alleviates this. Logic bugs are a much bigger problem.
>
> I tend to print a lot of tracing messages in my programs, in the form
>
> print (x, y, z)
>
> expecting to print the tuple (x,y,z) in a form that I can read back
> into an analysis program. That's going to break without throwing
> any syntax errors if I ever switch to Python 3.

I would hope and expect that 2to3 will properly add a second pair. But I
can see that that would be a problem with new code. To make your life
easier, and even save keystrokes:

>>> print((1,2,3))
(1, 2, 3)
>>> def tp(*args): print(args) # tuple print

>>> tp(1,2,3)
(1, 2, 3)

--
Terry Jan Reedy