[Python-ideas] Add annotations to global statement

Rob Cliffe rob.cliffe at btinternet.com
Thu Sep 6 15:17:03 CEST 2012


On 06/09/2012 13:30, Alexandre Bosc wrote:
> I think the annotations of parameters and  return value of a function, 
> a useful practice for the user of the function.
> As a function can modify or create global variables, and as it's 
> important for the end user,   I would appreciate to add annotations in 
> the global statement.
>
> An  annotation syntax similar to that of parameters  could be employed :
>
>     global var : expression
>     global var1 : expression1, var2 : expression2,...
>
>
> cheers,
>
> Alex (geoscience modeler)
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
>
Just to clarify:

Are you proposing that
     global var : expression
is equivalent to
     global var
     var = expression
?

If so, wouldn't the syntax
     global var = expression
be more readable?
Rob Cliffe





More information about the Python-ideas mailing list