Issue222790
Created on 2000-11-18.18:51:49 by bckfnn, last changed 2000-11-18.21:49:14 by bckfnn.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2000-11-18 18:51:49 | bckfnn | create | |
Created on 2000-11-18.18:51:49 by bckfnn, last changed 2000-11-18.21:49:14 by bckfnn.
| Messages | |||
|---|---|---|---|
| msg17 (view) | Author: Finn Bock (bckfnn) | Date: 2000-11-18.18:51:49 | |
A ClassCastException is thrown by the script below.
-------------- FILE: test118.py --------------
IntegerType = type(1)
class SpecialInt (IntegerType):
def __init__(self, n): IntegerType.__init__(self, n)
def double(self): return self*2
si = SpecialInt(12)
print si
print si + 1
print si + si
print 3 + si
-------------- END --------------
|
|||
| msg18 (view) | Author: Finn Bock (bckfnn) | Date: 2000-11-18.21:49:14 | |
Fixed. A subclass of builtin types are possible, but no API exists that the subclass can use/override to gain control of the builtin type. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2000-11-18 18:51:49 | bckfnn | create | |
Supported by Python Software Foundation,
Powered by Roundup