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

David Goldsmith d_l_goldsmith@yahoo....
Sat Aug 15 11:50:56 CDT 2009


As a curious "innocent bystander" that only goes along with earth shattering software change "kicking and screaming" ;-) why did the Python 3 PTB decide to change such a fundamental construct?

DG

--- On Sat, 8/15/09, Charles R Harris <charlesr.harris@gmail.com> wrote:

> From: Charles R Harris <charlesr.harris@gmail.com>
> Subject: Re: [SciPy-dev] change print statements to print functions in docstrings
> To: "SciPy Developers List" <scipy-dev@scipy.org>
> Date: Saturday, August 15, 2009, 9:44 AM
> 
> 
> On Sat, Aug 15, 2009 at 10:24 AM,
> Ralf Gommers <ralf.gommers@googlemail.com>
> wrote:
> 
> 
> 
> On
> Sat, Aug 15, 2009 at 11:37 AM, Charles R Harris <charlesr.harris@gmail.com>
> wrote:
> 
> 
> 
> 
> On Sat, Aug 15, 2009 at 7:59
> AM, Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
> wrote:
> 
> 
> 
>         Hi,
> 
> 
> 
>         I've started changing the print statements
> in numpy's doctrings
> 
> to print functions on the doc wiki, to meet the
> requirements of Python
> 
> 3.0. Any objections or comments?
> 
> 
> This can lead to some oddities:
> 
> In [6]: print(1,2,3)
> (1, 2, 3)
>  
> 
> I think it might be better to find out what  2to3 does in
> these circumstances first.
> 
> 
> 
> From the 2to3 docs:
> "2to3 can also refactor doctests.  To enable this
> mode, use the -d flag.
>  Note that only doctests will be refactored.  This
> also doesn’t require
> the module to be valid Python.  For example, doctest like
> examples in a reST
> document could also be refactored with this option."
> 
> Anyway, the change can also be made with a good editor and
> search-replace. I am all for changing this, my point was
> simply that the doc wiki is not the best tool to make
> changes like these (not that I don't love the doc wiki,
> it's great).
> 
> 
> 
> I'm not convinced it is a good idea, even
> pedagogically. First, all the python books I have are for
> the python-2.x versions, and second it saddles the students
> with having to make a distinction between printing single
> items vs printing multiple items. It's better, I think,
> to wait until we have a python 3.x version of numpy.
> 
> 
> That said, it would be interesting if someone ran some
> tests using 2to3 just to see how it works.
> 
> Chuck 
> 
> 
> 
> -----Inline Attachment Follows-----
> 
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
> 


      


More information about the Scipy-dev mailing list