Proposal for .py2, py3, etc. extensions. Was: A way to accommodate laguage changes

Chris Barker chrishbarker at home.net
Tue Jul 24 20:19:01 EDT 2001


James Logajan wrote:

> Sure: your proposal isn't bad. That is, absent any "pragma" the interpreter
> assumes "old" semantics. But it does require programmers doing new
> development to add that line of text in all their modules. And it has the
> nice effect of spitting out an error when run by a 1.5.2 interpreter. But it
> can get tiresome always adding that. So perhaps one should put the indicator
> in the module name itself:

I still think a line at the top of the module would be a limited
inconvenience. It's no more typing than:

while 1:
    x = something
    if something:
	break
	
compared to:
while x = something:

And we all think that's a good idea (don't we!)

In the long, run, I think relying on file extensions ios a bad idea.
Among othetr things, Python code is not neccesarily stored in files at
all (at least not when passed to the interpreter)

Still, on the right track....

-Chris


-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------



More information about the Python-list mailing list