FEEDBACK WANTED: Type/class unification

Carel Fellinger cfelling at iae.nl
Tue Jul 31 13:39:43 EDT 2001


Sam Penrose <sam at ddmweb.com> wrote:
> Guido van Rossum wrote:
>>> One minor suggestion:
>>> I think it would help if you set a convention for the name
>>> of the first argument in classmethods. Like self for standard
>>> methods. Well, even self can "work" here, too.

>> I think 'self' would be confusing.  I'd like to propose 'cls'.

> How about an English word or phrase in lieu of YATATL (yet another
> terse acronym to learn)? Insofar as "self" derives from the notion of
> an instance, we want somethign that derives from the notion of one's
> classification. 

At first a thought of what I want to propose as a joke on case, but
then, if you buy the argument for case sensitivity to be usefull to
distinguish instances and classes (I do) it might just be right.

So I propose Self, the class spelling of self, like in:

    def class_function(Self, args...)

As a bonus, this is in accordance with the Jungian view of life, where
self is used to point to the personal (lower) self, and Self denotes
the person transcending (higher) self.

Against it is that it would promote case sensitivity into the language as a
sanctioned convention, but then that's what has been decided, hasn't it:)

If the case sensitivity is a real show stopper we might settle for
"class self", like in:

    def class_function(class self, args...)

[in retrospect, I think I like a combination best, so "class Self"]

Now that we are talking case, I seem to remember that the Alice people
found that second guessing the spelling of library names was the real
problem.  So I was a bit surprised at first that the dictionary type
was lowercased, were as the names in the types module are uppercased.
(Later i realised that that was in accordance with int/long/str.)

I very much applaud your endeavour to heal the type/class split, but I
sure hope the end result will become simpler then what you have now.
My brain being of limmited capacity since the crash has problems with
things as two distinct method lookup behaviours. I understand your
explanation allright, but I fear I've to lookup the rules often, like
I can't get the corner cases of the new scoping rules fully into my
head:(  Whereas the other pecularities of the language are so well
hidden that I think I've grasped the language:)

I even hope the healing result get so simple that I really can do the
Meta Class Programming I've been dreaming about lately.
-- 
groetjes, carel



More information about the Python-list mailing list