Message416514
This is what functionality looks like when supplying incorrect attribute names with the patch.
Python 3.11.0a6+ (heads/bpo-47135-dirty:d4bb38f82b, Apr 1 2022, 20:01:56) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import _pydecimal
>>> ctx = _pydecimal.getcontext()
>>> ctx.precision = 10
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/run/media/sam/OS/Git/cpython/Lib/_pydecimal.py", line 3974, in __setattr__
raise AttributeError(
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'decimal.Context' object has no attribute 'precision'
>>> with _pydecimal.localcontext(precision=10) as ctx:
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/run/media/sam/OS/Git/cpython/Lib/_pydecimal.py", line 506, in localcontext
setattr(ctx, key, value)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/run/media/sam/OS/Git/cpython/Lib/_pydecimal.py", line 3974, in __setattr__
raise AttributeError(
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'decimal.Context' object has no attribute 'precision'
>>> import decimal
>>> ctx = decimal.getcontext()
>>> ctx.precision = 10
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'decimal.Context' object has no attribute 'precision'
>>> with decimal.localcontext(precision=10) as ctx:
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'precision' is an invalid keyword argument for this function
>>> |
|
Date |
User |
Action |
Args |
2022-04-01 19:51:26 | sam_ezeh | set | recipients:
+ sam_ezeh, ncoghlan, steven.daprano, corona10 |
2022-04-01 19:51:26 | sam_ezeh | set | messageid: <1648842686.19.0.630947381938.issue47135@roundup.psfhosted.org> |
2022-04-01 19:51:26 | sam_ezeh | link | issue47135 messages |
2022-04-01 19:51:26 | sam_ezeh | create | |
|