New submission from Andreas Kloeckner <[EMAIL PROTECTED]>:

Check out this transcript:
8< -----------------------------------------------------------------------
Python 2.5.2 (r252:60911, Aug  8 2008, 09:22:44) 
[GCC 4.3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class A(object):
...   def b(self):
...     pass
... 
>>> a = A()
>>> a.b < 0
False
>>> 
8< -----------------------------------------------------------------------

I would argue that the 'successful' comparison of a bound method with an
int is undesirable. This especially bad when you're refactoring a class
property into a class method and the property used to get used in
comparisons.
Instead of the expected exceptions, you get weird behavior.

----------
components: Interpreter Core
messages: 72961
nosy: inducer
severity: normal
status: open
title: Bound methods compare 'successfully' with ints
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3828>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to