Py2K wishes

William Tanksley wtanksle at hawking.armored.net
Mon Dec 27 22:04:57 EST 1999


On Mon, 27 Dec 1999 07:28:34 -0500, Paul Prescod wrote:
>I would love it if one of my Python nits was corrected in Python 2
>whenever that comes about. Consider the keywords "def" and "class"

>Kidding aside, "class" is a noun and "def" is an abbreviation for a
>verb. Furthermore, "def" is way too generic. Python has class
>definitions and function definitions. The keywords should be
>"func"/"function" and "class". 

I agree -- abbreviations are a little silly.

>-----

>The syntax for selecting base classes is un-Pythonic in the sense that
>it is not clearly obvious what is going on. Java's "extends" keyword is
>more Pythonic (if only the rest of Java was!).

I don't agree directly -- I find "class This(That):" to be quite clear.
In this case, minimal use of keywords is the focus.

However, I would like us to look at some other models for inheritance --
Sather's split between interface and implementation is interesting, as is
Lagoon's split between category and structure (Lagoon actually looks quite
Pythonic for a Pascal-derived language!).

Lagoon is discussed at
http://www.ics.uci.edu/~franz/publications/J9703%20ProgLanguageLagoona.pdf

>-----
>Python has an efficient multi-level dispatching mechanism that is used
>as the basis for name lookup and attribute lookup. The implementation of
>this mechanism should be made availab le to the programmer. I should be
>able to make a proxy object something like this:

>class Proxy:
>	def __init__ ( self, fallback ):
>		__fallback__=fallback

>a = Proxy( someObject )

>This would imply the following:

>class SomeClass( someParentClass ): pass
>assert SomeClass.__fallback__ == someParentClass
>assert SomeClass().__fallback__ == SomeClass.__fallback__

I don't have a clue what this is doing.  Sorry.

> Paul Prescod

-- 
-William "Billy" Tanksley, in hoc signo hack



More information about the Python-list mailing list