Hacker News new | past | comments | ask | show | jobs | submit login

print as a function made it into Python 2.6 (using future imports). It's probably one of the more purely stylistic choices in 3.X. The function style is probably better for pretty much all shipping code (as opposed to someone typing at an interpreter).

The Unicode switchover is where all the pain is, and it isn't particularly clear that there is a good way to do such a thing.




I for one like the 2.x style print function. I see why it would be a bad idea to have a separate syntax for print from a purist point of view.

But least for smallish scripts which print a lot it give you a better overview because the print line look different than other lines. Sometimes prints can almost be like comments.


> I for one like the 2.x style print function.

2.x didn't have a print function, unless you mean the one from 3 available with a from __future__ import.


In case the grandparent doesn't realize, 2.x has a print statement not function.


I meant function as in functionality. This is really pointless nitpicking.


Knowing the difference between functions and statements is not pointless nitpicking. Not in the least.


Normally I would agree with you - but one of the epic changes between 2.x and 3.x python, was the change of print from a statement to a function - so, in this case, it's not so much nitpicking as pointing out one of the major changes between the two streams of python.


Actually it's a procedure because it has a side-effect.


In python, they are called "functions" whether or not they have side effects. (And, actually, in most programming languages I've seen that have different constructs called "function" and "procedure", the difference is that functions have a return value and procedures don't -- usually, both can have side effects.)


Have you ever used a functional programming language?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: