3 ms·
> The print statement is a little more convenient in the REPL. IIRC ipython has a feature where you can prepend slash to any function (at the beginning of a li
by klibertp 10y ago
> The print statement is a little more convenient in the REPL.
IIRC ipython has a feature where you can prepend slash to any function (at the beginning of a line) to have parens inserted automatically, ie.
In [0]: /print "foo"
is executed as print("foo"). There - problem solved, and for all functions, not just one special case.
Honestly, the crazy `print >>fileobject, "foo"` syntax is enough of a reason for removing it (print statement) from the language. It was unpythonic and I'm surprised it lasted this long in the language.
- vram22 10y agoYes, I don't like that last usage too. Non-orthogonal syntax is slightly harder to learn / remember, and the more of if there is, the more the cognitive / memory load. Of course, no language can be perfectly orthogonal or regular, though I guess Lisp comes close. (Not an expert on language design or theory.)