4 ms·
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 sm
by ma2rten 13y ago
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.
- dragonwriter 13y ago> 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.
- montecarl 13y agoIn case the grandparent doesn't realize, 2.x has a print statement not function.
- ma2rten 13y agoI meant function as in functionality. This is really pointless nitpicking.
- yukichan 13y agoKnowing the difference between functions and statements is not pointless nitpicking. Not in the least.
- ghshephard 13y agoNormally 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.
- anaphor 13y agoActually it's a procedure because it has a side-effect.
- dragonwriter 13y agoIn 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.)
- anaphor 13y agoHave you ever used a functional programming language?