A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/039585.html below:

[Python-Dev] Alternate notation for global variable assignments

[Python-Dev] Alternate notation for global variable assignments [Python-Dev] Alternate notation for global variable assignmentsZack Weinberg zack at codesourcery.com
Sun Oct 26 13:14:37 EST 2003
I like Just's := concept except for the similarity to =, and I worry
that the presence of := in the language will flip people into "Pascal
mode" -- thinking that = is the equality operator.  I also think that
the notation is somewhat unnatural -- "globalness" is a property of
the _variable_, not the operator.  So I'd like to suggest instead

   :var       = value   # var in module scope
   :scope:var = value   # var in named enclosing scope

An advantage of this notation is that it can be used anywhere, not
just in an assignment.  This has primary value for people reading the
code -- if you have a fairly large class method that uses a module
variable (not by assigning it) somewhere in the middle, writing it
:var means the reader knows to go look for the assignment way up top.
This should obviously be optional, to preserve backward compatibility.

zw

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4