[Python-ideas] Python Numbers as Human Concept Decimal System

Steven D'Aprano steve at pearwood.info
Wed Mar 5 14:23:33 CET 2014


On Wed, Mar 05, 2014 at 11:42:14PM +1100, Chris Angelico wrote:

> I'm not sure I like the idea of tagging the end of the expression.
> Currently, the nearest Python has to that is the complex notation:
> 
> >>> 1+2j
> (1+2j)
> 
> And that works just fine when considered to be addition:
> 
> >>> a=1
> >>> b=2j
> >>> a+b
> (1+2j)
> 
> So really, what Python has is a notation for a j-suffixed float,
> meaning a complex number with no real part. You can't do that with
> Fraction:
> 
> >>> a=2
> >>> b=3F
> >>> a/b

Why not? If 3d is a Decimal with the value of 3, why couldn't 3F be a 
Fraction with the value of 3?


-- 
Steven


More information about the Python-ideas mailing list