[Python-Dev] Should vars() return modifiable dict? (original) (raw)

Larry Hastings larry at hastings.org
Fri Oct 5 15:01:02 CEST 2012


On 10/05/2012 01:59 PM, Devin Jeanpierre wrote:

I've never understood why locals() returned a mutable dictionary either, except that Python has no immutable dictionary type.

Ah, but these days it has types.MappingProxyType which provides a read-only wrapper around another mapping type. Perhaps that should be employed here.

//arry/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20121005/7aee8a0b/attachment.html>



More information about the Python-Dev mailing list