Message416513
I'm not sure what the implementation uses to enforce this, but decimal
contexts already seem to reject arbitrary attributes. So a naive
implementation that just setattr()'s the keyword arguments will
automatically fail:
>>> from decimal import getcontext
>>> ctx = getcontext()
>>> setattr(ctx, 'precision', 10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'decimal.Context' object has no attribute 'precision'
But you are absolutely correct that however we enforce it, we should
avoid allowing typos to silently fail. |
|
Date |
User |
Action |
Args |
2022-04-01 19:35:30 | steven.daprano | set | recipients:
+ steven.daprano, ncoghlan, corona10, sam_ezeh |
2022-04-01 19:35:28 | steven.daprano | link | issue47135 messages |
2022-04-01 19:35:28 | steven.daprano | create | |
|