This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Confusing DeprecationWarning
Type: behavior Stage:
Components: Interpreter Core Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: alejolp, benjamin.peterson, djc, terry.reedy
Priority: normal Keywords:

Created on 2009-05-26 21:23 by alejolp, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg88394 - (view) Author: Alejandro Santos (alejolp) Date: 2009-05-26 21:23
Comparing a lambda and a built-in by equality ("==") raises a
DeprecationWarning when the "-3" flag is used on Python 2.6.2:

$ python2.6 -3
Python 2.6.2 (r262:71600, Apr 28 2009, 16:17:29) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> (lambda x: x) == eval
__main__:1: DeprecationWarning: builtin_function_or_method inequality
comparisons not supported in 3.x
False

On Python 3.0.1 it works just fine:

$ python3.0
Python 3.0.1 (r301:69556, Apr 28 2009, 19:47:09) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> (lambda x: x) == eval
False
>>>
msg88527 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2009-05-29 19:47
I believe that is a bug.  The warning should be about 'order
comparisons', which did disappear, and not 'inequality comparisons', and
should not trigger on == or !=.
msg90027 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-07-02 17:07
Fixed in r73774.
History
Date User Action Args
2022-04-11 14:56:49adminsetgithub: 50369
2009-07-02 17:07:57benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg90027

resolution: fixed
2009-07-02 16:07:56djcsetnosy: + djc
2009-05-29 19:47:16terry.reedysetnosy: + terry.reedy
messages: + msg88527
2009-05-26 21:24:59alejolpsettype: behavior
2009-05-26 21:23:59alejolpcreate