How much is set in stone?

Chris Barker chrishbarker at home.net
Mon Nov 5 13:26:21 EST 2001


While nothing is actually set in stone, some things are pretty well
cemented in.

Jive Dadson wrote:
> Thanks.  Before I submit a formal proposal, let me run it by you guys.

That is a good idea, most PEPs start as a discussion here. AN a whle lot
more start that way and nver make it to a PEP.
 
> I've looked through all the PEPS and I was surprised that my suggestion
> is not already there.  So, here it is.  Please comment.

You can bet that this has been proposed by people new to Python again
and again and again, and I can promise you that this is one thing that
is very well cemented in. If there is one thing that makes Python
Python, is that it is a highly dynamic language. THat is not going to
change.

> option explicit
> 
> def initialized = 0
> def init_everything():
>         blah()
>         blah()
>         blah()
>         initialized = 1
> 
> The above code would work as anticipated.  No pesky "global" qualifier.

Actually, no it wouldn't. The second initialized here is a local
variable, and it should remain so. Having a variable in a function be
either local or global depending on something that is outside of the
funciton is asking for trouble. If you start changing that too, you
really won't have Python anymore!!

-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