Message155095
This issue was raised by Jim on Rietveld:
Currently, the order of arguments in Context.__init__() differs
from repr(Context):
>>> Context()
Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999999, Emax=999999999, capitals=1, flags=[], traps=[DivisionByZero, Overflow, InvalidOperation])
>>>
>>> Context(28, ROUND_HALF_EVEN, -999999999, 999999999, 1, [], [DivisionByZero, Overflow, InvalidOperation])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.2/decimal.py", line 3774, in __init__
flags = dict([(s, int(s in flags)) for s in _signals])
File "/usr/lib/python3.2/decimal.py", line 3774, in <listcomp>
flags = dict([(s, int(s in flags)) for s in _signals])
TypeError: argument of type 'int' is not iterable
>>>
I find this quite ugly. The repr() order is the good one, since
it moves the flag dictionaries to the end. I wanted to change
the order in Context.__init__() to match repr(), but I'm not
sure if such a change is possible.
I don't think Python code would initialize a context without keywords,
but C extensions might. |
|
Date |
User |
Action |
Args |
2012-03-07 16:17:45 | skrah | set | recipients:
+ skrah, lemburg, rhettinger, amaury.forgeotdarc, mark.dickinson, pitrou, vstinner, casevh, eric.smith, benjamin.peterson, jjconti, ced, Amaury.Forgeot.d'Arc, eric.snow, Ramchandra Apte, Jim.Jewett |
2012-03-07 16:17:45 | skrah | set | messageid: <1331137065.09.0.673206469993.issue7652@psf.upfronthosting.co.za> |
2012-03-07 16:17:44 | skrah | link | issue7652 messages |
2012-03-07 16:17:43 | skrah | create | |
|