[Python-ideas] "Read Only" namespaces

Richard Prosser richard.prosser at mail.com
Sat Mar 29 16:51:20 CET 2014


This is probably far-fetched where Python is concerned but I still think
that it could be useful. It is based on an idea that I had 36 years ago!

Quite simply, the principle is to allow changes to variables within a
function body (for example) but not outside of it, rather like the
Functional Programming paradigm. That of course excludes the use of global
variables and requires functions to return whatever is needed to the outer
scope. In my experience, globals are only needed to implement persistent
(inter-call) states anyway, so assuming that such a feature is available in
the language I believe that the "Read Only" proposal is viable.

This is highly unlikely to be implemented in Python any time soon (even
with an Interpreter/compiler option) and would imply some performance
overhead but I still think that it is a nice idea.

Any comments? Would a "Persistent Variables" PEP be interesting in its own
right?


Thanks ...

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140329/e045523b/attachment.html>


More information about the Python-ideas mailing list