This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients Elvis.Pranskevichus, amaury.forgeotdarc, mark.dickinson, python-dev, skrah, yselivanov
Date 2012-11-07.23:02:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1352329361.66.0.250014774421.issue16431@psf.upfronthosting.co.za>
In-reply-to
Content
"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)
History
Date User Action Args
2012-11-07 23:02:41amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, mark.dickinson, skrah, Elvis.Pranskevichus, python-dev, yselivanov
2012-11-07 23:02:41amaury.forgeotdarcsetmessageid: <1352329361.66.0.250014774421.issue16431@psf.upfronthosting.co.za>
2012-11-07 23:02:41amaury.forgeotdarclinkissue16431 messages
2012-11-07 23:02:41amaury.forgeotdarccreate