Python 3 compatible examples

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Python 3 compatible examples

Charles R Harris
Hi All,

This post is prompted by this PR. It would be good to come up with a timeline and plan for rewriting the examples to be Python 3 compatible. When we do so, we should also make it assumed that `from __future__ import print_function` has been executed when the examples are executed in Python 2.7. Might want to include `division` in that future import as well.

Anyway, wanted to raise the subject. Thoughts?

Chuck

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Python 3 compatible examples

Pauli Virtanen-3
pe, 2018-06-01 kello 14:17 -0600, Charles R Harris kirjoitti:

> This post is prompted by this PR <https://github.com/numpy/numpy/pull
> /11222>.
> It would be good to come up with a timeline and plan for rewriting
> the
> examples to be Python 3 compatible. When we do so, we should also
> make it
> assumed that `from __future__ import print_function` has been
> executed when
> the examples are executed in Python 2.7. Might want to include
> `division`
> in that future import as well.
>
> Anyway, wanted to raise the subject. Thoughts?

For Scipy, we converted the examples in the documentation to Python 3,
and have essentially ignored Python 2 compatibility. So far, I remember
no complaints about it.

        Pauli

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Python 3 compatible examples

Juan Nunez-Iglesias

On Sat, Jun 2, 2018, at 6:22 AM, Pauli Virtanen wrote:
> For Scipy, we converted the examples in the documentation to Python 3,
> and have essentially ignored Python 2 compatibility. So far, I remember
> no complaints about it.

I vote for what Pauli said.
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Python 3 compatible examples

Marten van Kerkwijk
Agreed, good to get started and stop worrying about python2 in the examples at least.
‚ÄčIf someone cuts&pastes and it fails, it is just a good reminder to get moving...
-- Marten

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Python 3 compatible examples

Jarrod Millman
In reply to this post by Juan Nunez-Iglesias
+1

On Fri, Jun 1, 2018 at 1:43 PM, Juan Nunez-Iglesias <[hidden email]> wrote:

>
> On Sat, Jun 2, 2018, at 6:22 AM, Pauli Virtanen wrote:
>> For Scipy, we converted the examples in the documentation to Python 3,
>> and have essentially ignored Python 2 compatibility. So far, I remember
>> no complaints about it.
>
> I vote for what Pauli said.
> _______________________________________________
> NumPy-Discussion mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/numpy-discussion
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion