[SciPy-dev] change print statements to print functions in docstrings

Robert Kern robert.kern@gmail....
Sat Aug 15 17:57:45 CDT 2009


2009/8/15 Stéfan van der Walt <stefan@sun.ac.za>:
> 2009/8/15 Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>:
>>> At this point in this thread, I've reached the "strong opinion" that I'm +1 w/ Charles: speaking as someone who's gung-ho to make the docstrings as pedagogically useful as possible, I feel code-docstring consistency trumps this - IMO, the docstrings should not be be changed prior to the code itself being changed.
>>
>> OK, you can revert the changes very easily as I paid attention to save
>> versions including only the modifications of print statements.
>
> Don't revert those changes.  Using "print" as a function is more
> consistent in style (one of the reasons it's been changed in 3.0).
> Doing it now saves us a lot of trouble later on.

print is simply not a function in 2.x. Abusing the Python 2.x syntax
to pretend like it is a function is terribly inconsistent when showing
Python 2.x code. It is bad style to use print() in Python 2.x. The
semantics are *not* the same when executing Python 3.x print() code in
Python 2.x. numpy does not support Python 3.x, yet.

+1 on reverting the changes.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the Scipy-dev mailing list