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/2012-October/122100.html below:

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

[Python-Dev] Should vars() return modifiable dict? [Python-Dev] Should vars() return modifiable dict?Devin Jeanpierre jeanpierreda at gmail.com
Fri Oct 5 13:59:37 CEST 2012
On Wed, Oct 3, 2012 at 11:34 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> I find myself unable to choose between 2) and 4), which suggests that
> the status quo wins and we keep the current behaviour.

What is the benefit of having a dict that represents a namespace, but
whose mutations don't mutate said namespace? Compare with option 2,
where the dict is mutable, and whose mutations mutate the namespace it
represents. That behavior is altogether significantly less surprising.

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

-- Devin
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