[Python-ideas] Proposal to add const-ness type hints to PEP-484

Wes Turner wes.turner at gmail.com
Mon Jul 11 14:08:52 EDT 2016

"Persistent / Immutable / Functional data structures for Python"

IIRC, there are a number of threads discussing adding const as a language
feature? It may be worth linking those here / in the gh issue? IIUC, the
linked proposal describes adding const as an annotation feature for static
analysis only.

Would const as a language feature have any effect on the gilectomy? e.g.
less locks required

Ways to achieve practical runtime const (~immutability):
* add a has_key() check in __setattr__
* define an @property without a propname.setter (for a __dunder_prefixed
class attr which will otherwise be name-mangled)
* const as a language feature


* from typing import Const
   this would be a great hint for static analysis, but would things really
be const?
On Jul 11, 2016 12:43 PM, "Siva Chandra via Python-ideas" <
python-ideas at python.org> wrote:

> Hello,
> I have submitted a proposal to add const-ness type hint constructs
> here: https://github.com/python/typing/issues/242
> Looking for feedback on the proposal.
> Thanks,
> Siva Chandra
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160711/2b286554/attachment.html>

More information about the Python-ideas mailing list