Issue1218089
Created on 2005-06-10.10:17:25 by johahn, last changed 2005-08-01.16:54:11 by fwierzbicki.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2005-06-10 10:17:25 | johahn | create | |
Created on 2005-06-10.10:17:25 by johahn, last changed 2005-08-01.16:54:11 by fwierzbicki.
| Messages | |||
|---|---|---|---|
| msg976 (view) | Author: Johan M. Hahn (johahn) | Date: 2005-06-10.10:17:25 | |
class myint(int): def __str__(self): return 42 Python 2.2: >>> str(myint()) Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: __str__ returned non-string (type int) Jython 2.2a2: >>> str(myint()) '0' int.derived is missing and PyIntegerDerived must be generated. Same for other types. |
|||
| msg977 (view) | Author: Frank Wierzbicki (fwierzbicki) | Date: 2005-06-18.16:50:27 | |
Logged In: YES user_id=193969 The immutable types don't need those classes. Your code should have been: class myint(int): def __str__(self): return '42' Note the quotes around 42 |
|||
| msg978 (view) | Author: Frank Wierzbicki (fwierzbicki) | Date: 2005-06-18.16:55:53 | |
Logged In: YES user_id=193969 oops didn't read the whole bug report. Looks like it is a bug but Derived classes are not the answer (I believe) |
|||
| msg979 (view) | Author: Frank Wierzbicki (fwierzbicki) | Date: 2005-07-24.17:44:37 | |
Logged In: YES user_id=193969 It turns out that Derived classes *are* the answer and I just misunderstood a past email. |
|||
| msg980 (view) | Author: Frank Wierzbicki (fwierzbicki) | Date: 2005-08-01.16:54:11 | |
Logged In: YES user_id=193969 Fixed. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2005-06-10 10:17:25 | johahn | create | |
Supported by Python Software Foundation,
Powered by Roundup