<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Sat, 19 Sep 2015 at 10:51 Chris Barker <<a href="mailto:chris.barker@noaa.gov">chris.barker@noaa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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 href="https://docs.python.org/2/howto/pyporting.html#prevent-compatibility-regressions" target="_blank">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></div></blockquote><div><br></div><div><span style="font-size:13px;line-height:19.5px">While in hindsight having a python3 __future__ statement that just turned on everything would be handy, this runs the risk of breaking code by introducing something that only works in a bugfix release and we went down that route with booleans in 2.2.1 and came to regret it.</span><br></div><div><span style="font-size:13px;line-height:19.5px"><br></span></div><div><span style="font-size:13px;line-height:19.5px">-Brett</span></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div></div><div>-Chris<br><br></div><div><br></div><div><br></div><div><br>-- <br><div><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 href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div></div>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a></blockquote></div></div>