FEEDBACK WANTED: Type/class unification

Mike C. Fletcher mcfletch at home.com
Mon Jul 30 19:14:42 EDT 2001


I thought someone had already proposed this, but didn't find it when I
looked:

class X:
	def x( class, *arguments, **namedarguments):
		doSomething( class ) # class of the object calling
		doSomething( X ) # the global X in our namespace...

Now, of course, that means that "class" just becomes a regular identifier as
far as the inside of class-methods goes, but oh well :) .  If that's too
radical, then ignore the doSomething( class ) stuff and just do
doSomething( X ), but that seems less in keeping with the rest of Python's
method-definition.

Alternately:
	def class x( *arguments, **namedarguments ):
		"Nicest beyond the above IMO"
	class def x( *arguments, **namedarguments ):
		"Still okay"

A thought (possibly someone else's), from someone who never much feels the
need for class methods :) ,
Mike

-----Original Message-----
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of William Tanksley
Sent: July 30, 2001 18:31
To: python-list at python.org
Subject: Re: FEEDBACK WANTED: Type/class unification


On Mon, 30 Jul 2001 13:12:00 -0700, Sam Penrose wrote:
>Guido van Rossum wrote:

>> 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)?

Yes, please.  Does anyone have any prior art on this topic?  'self' is
nice because it was in common use before.

>Insofar as "self" derives from the notion of
>an instance, we want somethign that derives from the notion of one's
>classification.

Good thinking.

>The GNU-based Roget's Thesaurus suggests for "class" :

>division, category, categorema[obs3], head, order, section;
>department, subdepartment, province, domain.  kind, sort, genus,
>species, variety, family, order, kingdom, race, tribe, caste, sept,
>clan, breed, type, subtype, kit, sect, set, subset; assortment;
>feather, kidney; suit; range; gender, sex, kin.

>I like order, genus, and kind. On balance I guess "kind" seems best:
>short, appropriate, and not a term I've noticed used in the corners of
>the language I deal with.

Of all the choices there, I like 'type' the best, because 'type' is
already used as a semi-synonym for class.  In fact, this change is
described as the type-class unification.

OTOH, perhaps we don't want a synonym for 'class'; perhaps we just want a
plural version of 'self'.  'selves'?  'us'?  'our'?

--
-William "Billy" Tanksley
--
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list