Python3k extended grammar

Roy Katz katz at Glue.umd.edu
Fri May 19 18:40:55 EDT 2000


On Thu, 18 May 2000, Paul Prescod wrote:

> Nobody has, as far as I know, ever spoken about having to declare
> variable types in Python. Many, many people have asked to be *allowed*
> to declare variables in Python. There is a big difference.


As one who enjoys programming both little (albeit elegant) scripts and
large projects alike, I feel safe with Python as a 'stable' language
set.  Here's a list of Unqualified Rumors we've been compiling: 

1. Python 3000 may be case-insensitive. 
2. It may allow type-checking.
3. It may have a more thorough garbage collection mechanism. 
4. dividing integers may yield a float. 


I don't really have an issue with (1) personally; however,
I find scripts such as 

   IMPORT OS, OS.PATH

   DIRNAMES  = '..'	
   OPENFILES = []
   FOR N IN OS.LISTDIR( DIRNAME ):
        F = OPEN( OS.PATH.JOIN( DIRNAME, N )
        OPENFILES.APPEND( F )

*really* difficult to comprehend (and perhaps, even *with*
case-insensitivity, and assuming even then that this doesn't break any
existing code), but if it helps budding programmers, I understand. 

for (4) my only concern is that int/float promotion would at least
remain consistent. For me, this is confusing as it is: 

   a = 5    # just practice variables  
   b = 3 

   c = float(a) / float(5)   # force c to be a float (supposedly)
   
if we have explicitly declared float types to work with, then this
wouldn't even be an issue for me.  But again, I could still write a 
module to implement this and then have its / operator overloaded. 

What I would like to know is where I can get information.  So many people
have asked about p3k in this group; I've searched python.org and Starship
and have come up with relatively little.  The TYPES-SIG (whose archives
are accessible from Python.org) sheds light on the types issue (then
again, I have issues with their proposals). 


Roey

btw -- the above is just my preference.  Whatever aids new students in
learning to program, so be it (at least I'll have Python 1.x). 




More information about the Python-list mailing list