[Python-Dev] Revamping Python's Numeric Model
Greg Stein
gstein@lyra.org
Sat, 4 Nov 2000 10:56:08 -0800
Oh, this is just simple:
(1.2).isreal()
1.2 .isreal()
As Thomas said, fixing the grammar/parser would be rather difficult, so just
expect people to use parens or an extra space if they want to use it on a
constant.
[ of course, it is very silly to make *any* changes to the grammar just to
allow people to use these on a constant; that is quite a silly "usage"
that we don't need to pander to; the above "workarounds", if you will, are
sufficient for the bozos who use it on a constant. ]
Cheers,
-g
On Sat, Nov 04, 2000 at 03:46:00PM +0100, Thomas Wouters wrote:
> On Sat, Nov 04, 2000 at 03:08:43PM +0100, Thomas Wouters wrote:
>
> > And the parser would have to be fixed (either rewritten into at least an
> > LL(2) parser, or the metagrammar hacked so that 'NUMBER' doesn't eat the .
> > after a number if it isn't followed by another number or whitespace.) (At
> > least IMHO, this isn't an insurmountable problem, or even a medium-sized
> > problem. It was just never necessary to fix it.)
>
> Actually, no, it isn't easily fixable, if at all. The problem is mostly the
> scientific notation:
>
> 1.e5
>
> Even if it was parsed properly, it is definately going to confuse people.
> They wouldn't be able to say, for instance,
>
> 1.e()
>
> ;P
>
> --
> Thomas Wouters <thomas@xs4all.net>
>
> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> http://www.python.org/mailman/listinfo/python-dev
--
Greg Stein, http://www.lyra.org/