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

Cameron Simpson cs at zip.com.au
Fri Mar 7 03:52:24 CET 2014


On 07Mar2014 00:32, MRAB <python at mrabarnett.plus.com> wrote:
> On 2014-03-06 23:59, Cameron Simpson wrote:
> >Coming to this very late, but I was interested in the first thread...
> >
> >On 05Mar2014 23:04, Steven D'Aprano <steve at pearwood.info> wrote:
> >>On Wed, Mar 05, 2014 at 11:29:10AM +0000, Oscar Benjamin wrote:
> >>> and I would also use Fraction
> >>> literals if available e.g. 1/3F.
> >>
> >>Out of curiosity, why F rather than f?
> >
> >Well, for me, +1 on 123f for "IEEE float" literals. i.e. the floats
> >in play in Python right now. [...]
> >So of course "F" is reasonable for fractions. But how hard does
> >that make the grammar? Because the parser now has to grab the entire
> >"1/3F" to construct the fraction. You can't just stick it in the lexer
> >at that point.
> >
> I think it would be confusing if there were "f" for "float" and "F" for
> "fraction". How about "r" for "rationals"?

I'm good with 'r'.
-- 
Cameron Simpson <cs at zip.com.au>

If you do not read the paper, you are uninformed. If you do read the
paper, you are misinformed. - Mark Twain


More information about the Python-ideas mailing list