Message155095
| Author |
skrah |
| Recipients |
Amaury.Forgeot.d'Arc, Jim.Jewett, Ramchandra Apte, amaury.forgeotdarc, benjamin.peterson, casevh, ced, eric.smith, eric.snow, jjconti, lemburg, mark.dickinson, pitrou, rhettinger, skrah, vstinner |
| Date |
2012年03月07日.16:17:43 |
| SpamBayes Score |
9.8794e-07 |
| Marked as misclassified |
No |
| Message-id |
<1331137065.09.0.673206469993.issue7652@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|