Roundup Robot added the comment:
New changeset 4240282a9f4a by Brett Cannon in branch 'default':
Issue #15471: Don't use mutable object as default values for the
http://hg.python.org/cpython/rev/4240282a9f4a
--
nosy: +python-dev
___
Python tracker
Changes by Brett Cannon br...@python.org:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15471
___
Barry A. Warsaw added the comment:
On Aug 05, 2012, at 11:50 PM, Brett Cannon wrote:
I went with Barry's approach but made it compatible with PEP 8 (bad, FLUFL;
no unneeded parens!).
I actually think I picked that up from the big guy himself, but I could be
misremembering. ;)
--
Brett Cannon added the comment:
Attached is a patch that drops all mutable default arguments to __import__()
and updates the docs. I went with Barry's approach but made it compatible with
PEP 8 (bad, FLUFL; no unneeded parens!). I also ignored the locals argument
since __import__ doesn't even
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15471
___
Meador Inge added the comment:
LGTM.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15471
___
___
Python-bugs-list mailing list
Unsubscribe:
Georg Brandl added the comment:
Looks good and safe to me. +1.
--
assignee: georg.brandl - brett.cannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15471
___
Barry A. Warsaw added the comment:
On Jul 30, 2012, at 04:39 AM, Meador Inge wrote:
Meador Inge added the comment:
How about the attached?
What about something like:
globals = ({} if globals is None else globals)
and similarly for locals?
--
Meador Inge added the comment:
How about the attached?
--
keywords: +patch
nosy: +meador.inge
stage: - patch review
type: - behavior
Added file: http://bugs.python.org/file26592/issue-15471.patch
___
Python tracker rep...@bugs.python.org
New submission from Barry A. Warsaw ba...@python.org:
Very minor style nit. In general, it's not considered good style to use
mutable objects in default argument values. importlib's
_bootstrap.__import__() does just this for its globals, locals, and fromlist
arguments.
The implementation
10 matches
Mail list logo