Why not 3.__class__ ?

Markus Jais info at mjais.de
Tue Oct 9 15:18:48 EDT 2001


brueckd at tbye.com wrote:

> On Tue, 9 Oct 2001, Markus Jais wrote:
> 
>> 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.
> 
> [snip]
>> but to write 3.foo is something I would like to have in Python
> [snip]
>> It would be great, if this would be possible in Python too
> 
> Care to elaborate on why it would be "great"? Guido's reply to Marcin
> points out that there doesn't seem to be any usefulness to it. So.... what
> problem would it solve or simplifiy?  What exactly would its benefit be,
> anyway?

it would be more consise.
in Ruby, everything is an object and I can invoke methods on everything
with object.method

the result is the same.
I just think, that ruby is "more" object oriented like Python
(another reason for this is, that in Ruby every instance variable
is private!)

but  this is just a matter of taste.
again. both are cool languages and I like both.
markus





More information about the Python-list mailing list