<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I totally agree here.<br>
<br>
<div class="moz-cite-prefix">On 19.09.2015 19:50, Chris Barker
wrote:<br>
</div>
<blockquote
cite="mid:CALGmxEJnLk5yvO+hN9SJ3Cuq5Wecp525dA3bGV-6OgD-QqK-KQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hi all,<br>
<br>
</div>
the common advise, these days, if you want to write py2/3
compatible code, is to do:<br>
<span style="font-family:monospace,monospace"><br>
from __future__ import absolute_import<br>
from __future__ import division<br>
from __future__ import print_function<br>
from __future__ import unicode_literals</span><br clear="all">
<div>
<div><br>
<a moz-do-not-send="true"
href="https://docs.python.org/2/howto/pyporting.html#prevent-compatibility-regressions">https://docs.python.org/2/howto/pyporting.html#prevent-compatibility-regressions</a><br>
<br>
</div>
<div>I'm trying to do this in my code, and teaching my
students to do it to.<br>
<br>
</div>
<div>but that's actually a lot of code to write.<br>
<br>
</div>
<div>It would be nice to have a:<br>
<br>
</div>
<div>from __future__ import py3<br>
<br>
</div>
<div>or something like that, that would do all of those in one
swipe.<br>
<br>
</div>
<div>IIIC, l can't make a little module that does that,
because the __future__ imports only effect the module in
which they are imported<br>
</div>
<div><br>
</div>
<div>Sure, it's not a huge deal, but it would make it easier
for folks wanting to keep up this best practice.<br>
<br>
</div>
<div>Of course, this wouldn't happen until 2.7.11, if an when
there even is one, but it would be nice to get it on the
list....<br>
<br>
</div>
<div>-Chris<br>
<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
-- <br>
<div class="gmail_signature"><br>
Christopher Barker, Ph.D.<br>
Oceanographer<br>
<br>
Emergency Response Division<br>
NOAA/NOS/OR&R (206) 526-6959 voice<br>
7600 Sand Point Way NE (206) 526-6329 fax<br>
Seattle, WA 98115 (206) 526-6317 main reception<br>
<br>
<a moz-do-not-send="true"
href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python-ideas mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-ideas@python.org">Python-ideas@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a>
Code of Conduct: <a class="moz-txt-link-freetext" href="http://python.org/psf/codeofconduct/">http://python.org/psf/codeofconduct/</a></pre>
</blockquote>
<br>
</body>
</html>