Message175131
"Py_INCREF(v); return v;" should be used only for immutable types, not for subclasses. in 3.2, the code below prints "3, None":
import decimal
class MyDecimal(decimal.Decimal):
x = None
def __new__(cls, value):
return super().__new__(cls, value)
return obj
a = MyDecimal("1.1")
a.x = 3
b = MyDecimal(a)
print(a.x, b.x) |
|
Date |
User |
Action |
Args |
2012-11-07 23:02:41 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, mark.dickinson, skrah, Elvis.Pranskevichus, python-dev, yselivanov |
2012-11-07 23:02:41 | amaury.forgeotdarc | set | messageid: <1352329361.66.0.250014774421.issue16431@psf.upfronthosting.co.za> |
2012-11-07 23:02:41 | amaury.forgeotdarc | link | issue16431 messages |
2012-11-07 23:02:41 | amaury.forgeotdarc | create | |
|