[issue9136] RuntimeError when profiling Decimal

Raymond Hettinger report at bugs.python.org
Thu Jul 1 23:16:48 CEST 2010


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

Stylistically, it would be nice to eliminate the local variable reassignment entirely:

self.Emin = DefaultContext.Emin if Emin is None else Emin
self.Emax = DefaultContext.Emax if Emax is None else Emax
self._ignored_flags = [] if _ignored_flags is None else _ignored_flags

Also, to keep the code consistent between versions, it may be better to avoid set/dict comprehensions and stick with the old:

    dict([(s, int(s in flags)) for s in _signals])

or slightly more modern generator comprehension:

    dict((s, int(s in flags)) for s in _signals)

----------
nosy: +rhettinger

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


More information about the Python-bugs-list mailing list