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/2001-January/012331.html below:

[Python-Dev] Read-only function attributes

[Python-Dev] Read-only function attributesKa-Ping Yee ping@lfw.org
Tue, 30 Jan 2001 00:38:12 -0800 (PST)
Hi there.

I see that the function attribute feature specifically allows
assignment to func_code and func_defaults, but no other special
attributes.  This seems really suspect to me.  Why would we want
to allow the reassignment of special attributes at all?

Functions have always been immutable objects, and i can see some
motivation for attaching mutable dictionaries to them, but it's
a more serious move to make the functions mutable themselves.

I don't recall any discussion about changing special attributes;
i don't see a clear purpose to them; and i do see a danger in
making it harder to be certain that a program is safe and predictable.

(Yes, i did notice that function attributes can't be set in
restricted mode, but the addition of extra features requiring
extra security checks makes me uneasy.)


-- ?!ng




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