Why not 3.__class__ ?
info at mjais.de
Tue Oct 9 21:18:48 CEST 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.
>> but to write 3.foo is something I would like to have in Python
>> 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,
it would be more consise.
in Ruby, everything is an object and I can invoke methods on everything
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
but this is just a matter of taste.
again. both are cool languages and I like both.
More information about the Python-list