Why not 3.__class__ ?

Markus Jais mjais at web.de
Tue Oct 9 10:30:26 EDT 2001


In article <cpvghoj4yu.fsf at cj20424-a.reston1.va.home.com>, "Guido van
Rossum" <guido at python.org> wrote:

> Marcin, I don't understand why you care so much about being able to
> write 3.foo.  It's painful to fix in the lexer, and probably leads to
> less useful error messages if someone makes a mistake in a float literal
> (e.g. "3.e 0").  And I see zero use for it: in practice, you will never
> ask for 3.foo -- you'll ask for x.foo where x happens to contain the
> value 3.
> 
> --Guido van Rossum (home page: http://www.python.org/~guido/)

hi,
I haven't followed the discussion
but to write 3.foo is something I would like to have in Python
I am a big fan of Ruby and there you can write
for example

-4.abs

which gives 4 (of course)

this is due to the fact, that in Ruby everything! is an object
It would be great, if this would be possible in Python too
on the other side, I understand that this would be a huge impact
on the language. maybe this is something for Python 3000 ?!?!

regards
markus

p.s. I do not want to start an unproductive flame war Ruby vs. Python
(I like both !!)



More information about the Python-list mailing list