[New-bugs-announce] [issue15471] importlib's __import__() argument style nit

Barry A. Warsaw report at bugs.python.org
Fri Jul 27 19:09:37 CEST 2012


New submission from Barry A. Warsaw <barry at 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 currently doesn't abuse this, or allow any of the extensions to abuse, it may be possible in the future to naively cause negative side-effects due to mutate the keyword arguments.  It would be better to use non-mutable default values in the argument list.

----------
assignee: brett.cannon
components: Library (Lib)
keywords: easy
messages: 166585
nosy: barry, brett.cannon
priority: low
severity: normal
status: open
title: importlib's __import__() argument style nit
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15471>
_______________________________________


More information about the New-bugs-announce mailing list