New submission from poelzi:

The Decimal class doesn't use lookups through self to construct results 
in functions like __add__ to generate the resulting object. This makes 
subclassing Decimal more or less senseless since all methods have to be 
wrapped instead of overriding the __new__ and __init__ methods, which 
could be enough for immutable type.
Currently I'm implementing a Money class which is more or less a 
Decimal with addition currency information. Because resulting Types 
generated with something like return Decimal(something) instead of 
self.__new__(...)

----------
components: Library (Lib)
messages: 58241
nosy: poelzi
severity: normal
status: open
title: Decimal can't be subclassed useful
versions: Python 2.5

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1562>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to