On Tue, Nov 21, 2017 at 3:31 AM, Steven D'Aprano <st...@pearwood.info>
wrote:

<snip>


>  The
> interesting (but is it useful?) concept is constant identifiers which
> cannot be re-bound or re-assigned once they are set the first time.
>

This would actually be a substantial shift in what Python is about --
currently the concept of type is all about values, not names -- there are
various rules about scope, and they can be adjusted with global and
nonlocal, but it's only about scope -- a name is still a name, and can be
bound to any type of object, etc.

static languages, on the other hand often (always) assign type to the name
itself -- so adding constants and the like makes sense. But changing the
property of a name (this name can not be rebound) is a big shift in what
names are about in Python -- and I don't think a good one.

And what's the use-case, really? beyond the use case for all sorts of
static typing...

in case it's not obvious: -1

-CHB



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

chris.bar...@noaa.gov
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to