Re: gmpy/decimal interoperation

2005-11-14 Thread Alex Martelli
Raymond L. Buvel <[EMAIL PROTECTED]> wrote: ... > This is a bit off topic but I would like to know how you would go about > doing an implicit operation with an mpz and Decimal becoming a Decimal. I would tweak Decimal.__new__ to accept an mpz and perform an int() on it before proceeding as it d

Re: gmpy/decimal interoperation

2005-11-14 Thread Raymond L. Buvel
Alex Martelli wrote: > As things stand now (gmpy 1.01), an instance d of decimal.Decimal cannot > transparently become an instance of any of gmpy.{mpz, mpq, mpf}, nor > vice versa (the conversions are all possible, but a bit laborious, e.g. > by explicitly going through string-forms). > > I'm thin

Re: gmpy/decimal interoperation

2005-11-14 Thread Nick Craig-Wood
Alex Martelli <[EMAIL PROTECTED]> wrote: > As things stand now (gmpy 1.01), an instance d of decimal.Decimal cannot > transparently become an instance of any of gmpy.{mpz, mpq, mpf}, nor > vice versa (the conversions are all possible, but a bit laborious, e.g. > by explicitly going through stri

gmpy/decimal interoperation

2005-11-13 Thread Alex Martelli
As things stand now (gmpy 1.01), an instance d of decimal.Decimal cannot transparently become an instance of any of gmpy.{mpz, mpq, mpf}, nor vice versa (the conversions are all possible, but a bit laborious, e.g. by explicitly going through string-forms). I'm thinking about possible ways to fix t