WHY PYTHON?

Steven D. Majewski (sdm7g@aemsun.med.Virginia.EDU)
Wed, 4 Dec 91 12:42:08 EST

Why Python ?
I mean that question in 2 senses.

(1) Why the name "python" ?

(2) What role do you see python as fulfilling or in what direction do
you anticipate its evolution ?
( Perhaps it *can* be "all things to all people", but I wonder if there
aren't some potential conflicts ahead between python as:
an interactive environment & command interpreter.
a command scripting language
a general purpose scheme-like symbol processing language
a GENERAL purpose high level language for everything else
an object oriented language
whatever else...
I see python as potentially good in all these roles, but perhaps
the needs and priorities differ. An interactive language needs
conciseness, even if it creates syntactic irregularity. Regularizing
built-in data types with user-objects, which would seem to be one
desirable direction, might conflict with adding more built-in's
( like vectors, for example ) for effeciency. )

---
 One issue I will raise ( re: regularizing built-ins and objects ): 
 I suggest that hooks to change the print representation of an object
 are desirable. Obviously, for user objects, one can write a '.print' 
 method function for the object, and maintain the convention of 
 consistently using that name ( or "._print" ). But it would be better
 if you could override "`" (backquote) for both user objects and 
 built-in data types. COMMON-LISP has this capability: It comes in 
 handy when you are dealing with large vectors/lists/tuples/etc. Instead
 of waiting for your terminal to print out a thousand number, you can 
 change the print representation to be something like: 
  "List of size=1024 : ( 0, 1, 2,  ... 1021, 1022, 1023 )" 
 Minimally, you should be able to change the string backquote returns. 
 Maximally, you should be able to change the action when evaluating a 
 symbol, i.e. , currently typing a symbol causes the equivalent to 
 'print `symbol` ' to occur. Instead of:
   >>> a = [ 1,2,3,4,5 ]
   >>> a
   [ 1, 2, 3, 4, 5 ]
 Typing 'a' could cause a plot of the values in a window. 
 ( Probably this last is too much, and should be left to a user-level
   interpreted written on top of python. )

In general, I think that regularization of built-in data types and user written objects is a good direction: allow operators like '+' to be defined for user-objects, and let built-ins be used as classes for inheritance. i.e. "class myList() = list: "

- Steve

======== "If you have a hammer, find a nail" - George Bush,'91 ========= Steven D. Majewski University of Virginia Physiology Dept. sdm7g@Virginia.EDU Box 449 Health Sciences Center Voice: (804)-982-0831 1600 Jefferson Park Avenue FAX: (804)-982-1616 Charlottesville, VA 22908