deprecated stuff in standard library
I have noticed that deprecated stuff is still being used in the standard Python library. When using modules that contain deprecated stuff you get a warning, and as a mere user there isn't much you can do about that. As a general rule, the Python standard library should not use deprecated constructs in non-deprecated (or otherwise deprecated) modules. The case I am running into is that mhlib uses multifile (in 2.6). -- Sjoerd Mullender
Isn't mhlib itself deprecated? (It's gone in Py3k.)
On Fri, Feb 19, 2010 at 4:33 AM, Sjoerd Mullender
I have noticed that deprecated stuff is still being used in the standard Python library. When using modules that contain deprecated stuff you get a warning, and as a mere user there isn't much you can do about that.
As a general rule, the Python standard library should not use deprecated constructs in non-deprecated (or otherwise deprecated) modules.
The case I am running into is that mhlib uses multifile (in 2.6).
-- --Guido van Rossum (python.org/~guido)
On 2010-02-19 14:10, Guido van Rossum wrote:
Isn't mhlib itself deprecated? (It's gone in Py3k.)
I wouldn't like that, but it is beside my point. If a module is deprecated, then it should not be used in released code. If mhlib is deprecated, it doesn't tell you about it. mhlib uses multifile and multifile does tell you it is deprecated, and that is pretty annoying.
On Fri, Feb 19, 2010 at 4:33 AM, Sjoerd Mullender
wrote: I have noticed that deprecated stuff is still being used in the standard Python library. When using modules that contain deprecated stuff you get a warning, and as a mere user there isn't much you can do about that.
As a general rule, the Python standard library should not use deprecated constructs in non-deprecated (or otherwise deprecated) modules.
The case I am running into is that mhlib uses multifile (in 2.6).
-- Sjoerd Mullender
Sjoerd Mullender wrote:
On 2010-02-19 14:10, Guido van Rossum wrote:
Isn't mhlib itself deprecated? (It's gone in Py3k.)
I wouldn't like that, but it is beside my point. If a module is deprecated, then it should not be used in released code. If mhlib is deprecated, it doesn't tell you about it. mhlib uses multifile and multifile does tell you it is deprecated, and that is pretty annoying.
This is because no one has gotten around to it. Create a bug report for it, and preferably attach a patch with tests. Eric.
Eric Smith
This is because no one has gotten around to it. Create a bug report for it, and preferably attach a patch with tests.
Eric.
Actually, it gives py3k warning about "mhlib" + 2 others warnings: ./python/release26-maint/ $ ./python -Wd -3 -c "import mhlib" -c:1: DeprecationWarning: the mhlib module has been removed in Python 3.0; use the mailbox module instead ./python/release26-maint/Lib/mhlib.py:82: DeprecationWarning: in 3.x, mimetools has been removed in favor of the email package import mimetools ./python/release26-maint/Lib/mhlib.py:83: DeprecationWarning: the multifile module has been deprecated since Python 2.5 import multifile
On 2010-02-19 14:45, Eric Smith wrote:
Sjoerd Mullender wrote:
On 2010-02-19 14:10, Guido van Rossum wrote:
Isn't mhlib itself deprecated? (It's gone in Py3k.)
I wouldn't like that, but it is beside my point. If a module is deprecated, then it should not be used in released code. If mhlib is deprecated, it doesn't tell you about it. mhlib uses multifile and multifile does tell you it is deprecated, and that is pretty annoying.
This is because no one has gotten around to it. Create a bug report for it, and preferably attach a patch with tests.
My point is, as a matter of *policy*, nothing should be released that uses deprecated stuff. I can't create a bug report about wrong (or incomplete) policies.
Eric.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/sjoerd.mullender%40cwi.nl
-- Sjoerd Mullender
Sjoerd Mullender wrote:
My point is, as a matter of *policy*, nothing should be released that uses deprecated stuff. I can't create a bug report about wrong (or incomplete) policies.
The policy is more that the test suite shouldn't raise Deprecation Warnings unless it is explicitly checking for them (or otherwise testing known-deprecated code). If there is a hole in the test suite coverage such that paths that trigger deprecated code are not exercised by the regression tests, then that is a bug. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia ---------------------------------------------------------------
On 2010-02-19 16:23, Nick Coghlan wrote:
Sjoerd Mullender wrote:
My point is, as a matter of *policy*, nothing should be released that uses deprecated stuff. I can't create a bug report about wrong (or incomplete) policies.
The policy is more that the test suite shouldn't raise Deprecation Warnings unless it is explicitly checking for them (or otherwise testing known-deprecated code).
The policy should also be, if someone decides (or rather, implements) a deprecation of a module, they should do a grep to see where that module is used and fix the code. It's not rocket science.
If there is a hole in the test suite coverage such that paths that trigger deprecated code are not exercised by the regression tests, then that is a bug.
Cheers, Nick.
-- Sjoerd Mullender
On Fri, Feb 19, 2010 at 9:03 AM, Sjoerd Mullender
The policy should also be, if someone decides (or rather, implements) a deprecation of a module, they should do a grep to see where that module is used and fix the code. It's not rocket science.
I'm not sure if you're aware of it, but you're starting to sound a little rude. ISTM that it doesn't make sense to waste effort ensuring that deprecated code is updated to not call other deprecated modules. Of course, all released non-deprecated code should steer clear of deprecated apis. -Mike
On Fri, Feb 19, 2010 at 5:41 PM, Mike Klaas
On Fri, Feb 19, 2010 at 9:03 AM, Sjoerd Mullender
wrote: The policy should also be, if someone decides (or rather, implements) a deprecation of a module, they should do a grep to see where that module is used and fix the code. It's not rocket science.
I'm not sure if you're aware of it, but you're starting to sound a little rude.
He's just being Dutch. :-)
ISTM that it doesn't make sense to waste effort ensuring that deprecated code is updated to not call other deprecated modules. Of course, all released non-deprecated code should steer clear of deprecated apis.
Read again. Sjoerd meant it exactly the other way around. When a module is deprecated it is *not* a wasted effort to ensure that no other (undeprecated) modules depend on it! -- --Guido van Rossum (python.org/~guido)
My point is, as a matter of *policy*, nothing should be released that uses deprecated stuff. I can't create a bug report about wrong (or incomplete) policies.
Sure you can. Write a bug report asking that PEP 4 gets amended with specific wording. Not that PEP 4 is followed in practice at all, but if the policy was in place and just not followed, that's a bug. Regards, Martin
On Fri, Feb 19, 2010 at 08:40, Sjoerd Mullender
On 2010-02-19 14:10, Guido van Rossum wrote:
Isn't mhlib itself deprecated? (It's gone in Py3k.)
I wouldn't like that, but it is beside my point. If a module is deprecated, then it should not be used in released code. If mhlib is deprecated, it doesn't tell you about it. mhlib uses multifile and multifile does tell you it is deprecated, and that is pretty annoying.
I see the deprecation warning upon importing mhlib in 2.6 and trunk (with -Wd).
participants (8)
-
"Martin v. Löwis"
-
Brian Curtin
-
Eric Smith
-
Florent Xicluna
-
Guido van Rossum
-
Mike Klaas
-
Nick Coghlan
-
Sjoerd Mullender