msg55643 - (view) |
Author: Richard Katz (richkatz) |
Date: 2007-09-04 20:57 |
Is there supposed to be a way to do for x in 1,2,3: print x, If so, it's appears to be not working. Is it just not in this release? If not, I would think that leaving out the print statement (just because there is a print function) would represent a major problem for cross-platform books and training materials. Just a thought. How would one achieve this capability in Python 3.0? Was it the intention to remove this capability? Thank you. Regards, Rich |
|
|
msg55646 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2007-09-04 21:31 |
What's wrong with py> for x in 1,2,3:print(x,end=" ") ... 1 2 3 Closing as invalid. |
|
|
msg55674 - (view) |
Author: Richard Katz (richkatz) |
Date: 2007-09-06 00:10 |
"What's wrong with py> for x in 1,2,3:print(x,end=" ")" ------------------------- I'd like to suggest (for those of us just now focusing on Python 3.0) replacing the last 3 bullet points of the paragraph "Common Stumbling Blocks?" http://docs.python.org/dev/3.0/whatsnew/3.0.html With the following simple reference: "The print statement has been REMOVED and is replaced by a print() function. SEE PEP 3105." Rather than burying 3105 in the middle of "other language changes." That would do a lot to clear it up. A) Especially I'd like to suggest getting rid of the quite cryptic: "You’ll be finding yourself typing print x a lot in interactive mode." I had no idea that was a *warning message - meaning "it won't work..." And B) The rather misleading - "Also, print and print (x, y) behave differently without warning:" They certainly do... But not in the way explained. "print" now displays "" since it's a function... What they probably meant was print()? Where would I suggest (or make) these changes to What's New? Is there a Doc Wiki? Thanks! Regards, Rich -----Original Message----- >From: "=?utf-8?q?Martin_v._L=C3=B6wis?=" <report@bugs.python.org> >Sent: Sep 4, 2007 5:31 PM >To: richkatz@acm.org >Subject: [] Is there just no PRINT statement any more? Or it just doesn't work. > > >Martin v. Löwis added the comment: > >What's wrong with > >py> for x in 1,2,3:print(x,end=" ") >... >1 2 3 > >Closing as invalid. > >---------- >nosy: +loewis >resolution: -> invalid >status: open -> closed > >__________________________________ >Tracker <report@bugs.python.org> ><http://bugs.python.org/issue1101> >__________________________________ |
|
|
msg55677 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2007-09-06 06:35 |
A plain "print" only results in output of "" in interactive mode, as interactive mode will not only perform the action, but also display the result. In a Python script, a plain "print" will have no effect. Guido, can you take a look at the proposed "what's new" changes? |
|
|
msg55694 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2007-09-06 14:47 |
OK, I've added a big section about print to the front of the "common stumbling blocks section, with all the info about print together, and a few examples to clarify the most common changes. You can see the changes in subversion; they'll be live on docs.python.org/dev/3.0/ in half a day or less. |
|
|