<div dir="ltr"><div>+1.<br><br></div>The language seems a bit ambiguous: "deprecated from 3.5 onward" -- what if a module was deprecated in 3.3 or 3.4 but still present in 3.5? I assume those are also included, but the language makes it possible to interpret this as applying only to modules that were first marked as deprecated in 3.5...<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 11, 2015 at 10:42 AM, Brett Cannon <span dir="ltr"><<a href="mailto:bcannon@gmail.com" target="_blank">bcannon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Since everyone seems happy with the proposal to keep deprecated modules in Python 3 until Python 2.7 reaches EOL, here are my proposed changes to PEP 4. If no one objects I will commit the change and then update formatter and imp to say they will be removed once Python 2.7 is no longer supported.<div><br></div><div><br><div><br></div><div><div>--- a/pep-0004.txt<span style="white-space:pre-wrap"> </span>Fri Sep 11 10:39:21 2015 -0700</div><div>+++ b/pep-0004.txt<span style="white-space:pre-wrap"> </span>Fri Sep 11 10:39:24 2015 -0700</div><div>@@ -2,7 +2,7 @@</div><div> Title: Deprecation of Standard Modules</div><div> Version: $Revision$</div><div> Last-Modified: $Date$</div><div>-Author: Martin von Löwis <<a href="mailto:martin@v.loewis.de" target="_blank">martin@v.loewis.de</a>></div><div>+Author: Brett Cannon <<a href="mailto:brett@python.org" target="_blank">brett@python.org</a>>, Martin von Löwis <<a href="mailto:martin@v.loewis.de" target="_blank">martin@v.loewis.de</a>></div><div> Status: Active</div><div> Type: Process</div><div> Content-Type: text/x-rst</div><div>@@ -50,6 +50,15 @@</div><div> releases that immediately follows the deprecation; later releases may</div><div> ship without the deprecated modules.</div><div> </div><div>+For modules existing in both Python 2.7 and Python 3.5</div><div>+------------------------------------------------------</div><div>+In order to facilitate writing code that works in both Python 2 & 3</div><div>+simultaneously, any module deprecated from Python 3.5 onwards that</div><div>+also exists in Python 2.7 will not be removed from the standard</div><div>+library until Python 2.7 is no longer supported. Exempted from this</div><div>+is any module in the idlelib package as well as any exceptions</div><div>+granted by the Python development team.</div><div>+</div><div> </div><div> Procedure for declaring a module undeprecated</div><div> =============================================</div><div>@@ -258,12 +267,16 @@</div><div>          Remove from 2.7</div><div>   Documentation: None</div><div> </div><div>+   Module name:  imp</div><div>+   Rationale:   Replaced by the importlib module.</div><div>+   Date:      2013-02-10</div><div>+   Documentation: Deprecated as of Python 3.4.</div><div>+</div><div>   Module name:  formatter</div><div>   Rationale:   Lack of use in the community, no tests to keep</div><div>          code working.</div><div>-   Documentation: Deprecated as of Python 3.4 by raising</div><div>-          PendingDeprecationWarning. Slated for removal in</div><div>-          Python 3.6.</div><div>+   Date:      2013-08-12</div><div>+   Documentation: Deprecated as of Python 3.4.</div><div> </div><div> </div><div> Deprecation of modules removed in Python 3.0</div></div><div><div class="h5"><div><br></div><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, 8 Sep 2015 at 09:59 Brett Cannon <<a href="mailto:bcannon@gmail.com" target="_blank">bcannon@gmail.com</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">There are two discussions going on in the issue tracker about deprecating some modules and it has led to the inevitable discussion of Python 2/3 compatibility (I'm not even going to bother mentioning the issue #s as this thread is not about the modules specifically but module deprecation in general). Because I'm tired of rehashing the same discussion every time a module deprecation comes up I would like to make an official decision that we can follow any time we decide to deprecate a module.<div><br></div><div>The approaches to module deprecation I have seen are:</div><div>1. Nothing changes to the deprecation process; you deprecate a module and remove it in one to two releases</div><div>2. Deprecate the module but with no plans for removal until Python 2.7 reaches its EOL (I have been calling this Python 4)</div><div>3. Document the deprecation but no actual code deprecation</div><div><br></div><div>I'm personally in the #2 camp. I want users to be fully aware that the module in question is not being updated and possibly not even getting non-critical bugfixes, but it's still there in Python 3 in order to make sure that you can have code which straddles Python 2 & 3 more easily.</div><div><br></div><div>I don't like #1 because when the module exists in python 2.7 as it makes transitioning from Python 2 a bit harder. Leaving code in the stdlib as deprecated isn't going to kill us, especially if we make it clear the code only exists for transitioning purposes and you very well may have to work around any bugs you come across (and yes, this means changing my stance for the formatter module's deprecation).</div><div><br></div><div>I don't like #3 because if you have an API memorized or you copied some code you found online you very well may not realize a module is deprecated. It's not difficult to silence a deprecation warning and you can make it so that even if you use -Werror your deprecated module imports continue to work without throwing an exception while all other deprecations do throw an exception.</div><div><br></div><div>Whatever decision we come to I will update PEP 4 and then personally go through the various deprecated modules in Python 3.6 and tweak them as necessary to follow whatever policy we come up with.</div></div></blockquote></div></div></div></div></div></div>
<br>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>