Issue1747
Created on 2008-01-06 22:46 by jyasskin, last changed 2008-01-07 06:11 by jyasskin.
|
msg59412 - (view) |
Author: Jeffrey Yasskin (jyasskin) |
Date: 2008-01-06 22:46 |
|
Python 2.6a0 (trunk:59791M, Jan 6 2008, 12:22:37)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import abc
[30620 refs]
>>> class A:
... __metaclass__ = abc.ABCMeta
...
[30650 refs]
>>> class B:
... pass
...
[30659 refs]
>>> issubclass(B, A)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jyasskin/src/python/trunk-abc/Lib/abc.py", line 191, in
__subclasscheck__
if cls in subclass.__mro__:
AttributeError: class B has no attribute '__mro__'
[30701 refs]
>>>
This causes Decimal to break in interesting ways when I make it subclass
numbers.Real. test_abc doesn't catch it because it declares
__metaclass__=type at the top level. :-(
This looks relatively easy to fix, so I'll work on a patch.
|
|
msg59422 - (view) |
Author: Jeffrey Yasskin (jyasskin) |
Date: 2008-01-07 00:09 |
|
This is certainly not the only way to fix this. Is it the best?
|
|
msg59426 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2008-01-07 02:42 |
|
lgtm
|
|
msg59433 - (view) |
Author: Jeffrey Yasskin (jyasskin) |
Date: 2008-01-07 06:11 |
|
Committed as r59809.
|
|
| Date |
User |
Action |
Args |
| 2008-01-07 06:11:37 | jyasskin | set | status: open -> closed messages:
+ msg59433 |
| 2008-01-07 02:42:07 | gvanrossum | set | resolution: accepted messages:
+ msg59426 |
| 2008-01-07 00:09:23 | jyasskin | set | keywords:
+ patch files:
+ subclass_oldstyle.patch messages:
+ msg59422 title: isinstance(NotSubclassOfObject, InstanceOfAbcMeta) fails instead of returning False -> issubclass(NotSubclassOfObject, InstanceOfAbcMeta) fails instead of returning False |
| 2008-01-06 23:18:30 | jyasskin | link | issue1623 dependencies |
| 2008-01-06 22:46:33 | jyasskin | create | |
|