Message290823
The simplest example:
def mydec(cls):
return type(cls.__name__, cls.__bases__, dict(cls.__dict__))
@mydec
class MyList(list):
def extend(self, item):
super(MyList, self).extend(item)
def insert(self, index, object):
super().insert(index, object)
>>> lst = MyList()
>>> lst.extend([2,3])
>>> lst.insert(0, 1)
TypeError: super(type, obj): obj must be an instance or subtype of type
>>> lst
[2, 3]
If this is intended behavior, at least the error message could be fixed. |
|
Date |
User |
Action |
Args |
2017-03-30 06:36:49 | bup | set | recipients:
+ bup |
2017-03-30 06:36:49 | bup | set | messageid: <1490855809.89.0.267666010996.issue29944@psf.upfronthosting.co.za> |
2017-03-30 06:36:49 | bup | link | issue29944 messages |
2017-03-30 06:36:49 | bup | create | |
|