Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
erlanger
on Aug 28, 2009
|
parent
|
context
|
favorite
| on:
How To Let People Know You're A Bad Python Program...
Nice explanation. Note that I
did
wrap my print arg in parens, however. When I heard they were changing it to a function in 3 I made this a habit.
blasdel
on Aug 28, 2009
[–]
Using parens that way with the print statement is a bad idea. You aren't using it like a function -- the parens are parsed as an expression.
statement function print(1) 1 1 print(1,2) (1, 2) 1 2 print(1,2), 3 (1, 2) 3 SyntaxError
Just use the old syntax, and let 2to3 take care of you when the time comes.
erlanger
on Aug 28, 2009
|
parent
[–]
I don't think I've ever used print that way. If I need to print more than one thing, it's clearer to use regular string formatting. Thanks for clarifying that though, interesting.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: