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.

Author exarkun
Recipients exarkun
Date 2008-08-04.19:13:32
SpamBayes Score 0.0013704203
Marked as misclassified No
Message-id <1217877214.51.0.0221142821046.issue3500@psf.upfronthosting.co.za>
In-reply-to
Content
If a method is inherited by two different classes, then the unbound
method objects which can be retrieved from those classes compare equal
to each other.  For example:

  Python 2.6b2+ (trunk:65502M, Aug  4 2008, 15:05:07)
  [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> class X:
  ...     def y(self):
  ...             pass
  ...
  >>> class A(X):
  ...     pass
  ...
  >>> class B(X):
  ...     pass
  ...
  >>> A.y == B.y
  True

This is bad behavior because A.y and B.y are otherwise distinguishable
(for example, they repr differently, they have different values for the
`im_class´ attribute, they cannot be used interchangably for invoking
the method because they place different type restrictions on the `self´
parameter, etc).
History
Date User Action Args
2008-08-04 19:13:34exarkunsetrecipients: + exarkun
2008-08-04 19:13:34exarkunsetmessageid: <1217877214.51.0.0221142821046.issue3500@psf.upfronthosting.co.za>
2008-08-04 19:13:33exarkunlinkissue3500 messages
2008-08-04 19:13:32exarkuncreate