This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sam_ezeh
Recipients corona10, ncoghlan, sam_ezeh, steven.daprano
Date 2022-04-01.19:51:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648842686.19.0.630947381938.issue47135@roundup.psfhosted.org>
In-reply-to
Content
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
>>>
History
Date User Action Args
2022-04-01 19:51:26sam_ezehsetrecipients: + sam_ezeh, ncoghlan, steven.daprano, corona10
2022-04-01 19:51:26sam_ezehsetmessageid: <1648842686.19.0.630947381938.issue47135@roundup.psfhosted.org>
2022-04-01 19:51:26sam_ezehlinkissue47135 messages
2022-04-01 19:51:26sam_ezehcreate