Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It’s really surprising how converting print from a statement to a function made repl debugging much less convenient.


I don't see "print(x)" being in any way worse then "print x". If you want to save some characters, you can always just write the symbol in the REPL line:

    >>> x=42
    >>> x
    42
This already works in the standard python REPL, no need for ipython. You can literally just omit the print call/statement:

    >>> print("the answer to life is %d" % x, "not 0")
   the answer to life is 42 not 0
   >>> "the answer to life is %d" % x, "not 0"
   ('the answer to life is 42', 'not 0')


How so?


I can’t give a logical explanation, but after 3 years, “print(x)” in the repl is still a cognitive dissonance whereas “print x” is natural.

(Doesn’t bother me in the editor, only in the repl)




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

Search: