subclassing Decimal

2005-02-21 Thread [EMAIL PROTECTED]
I was interested in playing around with Decimal and subclassing it. For example, if I wanted a special class to permit floats to be automatically converted to strings. from decimal import Decimal class MyDecimal(Decimal): def __init__(self, value): if isinstance(value

Re: subclassing Decimal

2005-02-21 Thread Steven Bethard
[EMAIL PROTECTED] wrote: I was interested in playing around with Decimal and subclassing it. For example, if I wanted a special class to permit floats to be automatically converted to strings. from decimal import Decimal class MyDecimal(Decimal): def __init__(self, value):

Re: subclassing Decimal

2005-02-21 Thread [EMAIL PROTECTED]
STeVe, Thanks for the response. Very clear. yea-though-I-walk-thru-the-valley-of-__new__-I-will-fear-no-super-ly y'rs, -Jeff -- http://mail.python.org/mailman/listinfo/python-list

Re: subclassing Decimal

2005-02-22 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: yea-though-I-walk-thru-the-valley-of-__new__-I-will-fear-no-super-ly That's beautiful }:> Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.sk