From f48c5bb4a135812f50f840b916eef8877634fa1a Mon Sep 17 00:00:00 2001 From: abkmystery Date: Tue, 31 Dec 2024 11:14:08 -0600 Subject: [PATCH 1/6] Fix: Change BasicContext to data directive in decimal module documentation --- Doc/library/decimal.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index c9a3e448cad063..a42b98537a50f8 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1033,10 +1033,10 @@ New contexts can also be created using the :class:`Context` constructor described below. In addition, the module provides three pre-made contexts: -.. class:: BasicContext +.. data:: BasicContext - This is a standard context defined by the General Decimal Arithmetic - Specification. Precision is set to nine. Rounding is set to + This is a predefined context object defined by the General Decimal Arithmetic Specification. + Precision is set to nine. Rounding is set to :const:`ROUND_HALF_UP`. All flags are cleared. All traps are enabled (treated as exceptions) except :const:`Inexact`, :const:`Rounded`, and :const:`Subnormal`. From 1e8607018c29045c8bc1cbeeaff95e2b21e126d8 Mon Sep 17 00:00:00 2001 From: abkmystery Date: Tue, 31 Dec 2024 11:53:27 -0600 Subject: [PATCH 2/6] Fix: Update directives for ExtendedContext and DefaultContext, revert 'standard' terminology --- Doc/library/decimal.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index a42b98537a50f8..0dfeb088227e35 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1035,7 +1035,7 @@ described below. In addition, the module provides three pre-made contexts: .. data:: BasicContext - This is a predefined context object defined by the General Decimal Arithmetic Specification. + This is a standard context object defined by the General Decimal Arithmetic Specification. Precision is set to nine. Rounding is set to :const:`ROUND_HALF_UP`. All flags are cleared. All traps are enabled (treated as exceptions) except :const:`Inexact`, :const:`Rounded`, and @@ -1044,7 +1044,7 @@ described below. In addition, the module provides three pre-made contexts: Because many of the traps are enabled, this context is useful for debugging. -.. class:: ExtendedContext +.. data:: ExtendedContext This is a standard context defined by the General Decimal Arithmetic Specification. Precision is set to nine. Rounding is set to @@ -1057,7 +1057,7 @@ described below. In addition, the module provides three pre-made contexts: presence of conditions that would otherwise halt the program. -.. class:: DefaultContext +.. data:: DefaultContext This context is used by the :class:`Context` constructor as a prototype for new contexts. Changing a field (such a precision) has the effect of changing the From 5addb1f2764dcc5c9f17b1fad0d616ad3e216e07 Mon Sep 17 00:00:00 2001 From: abkmystery Date: Tue, 31 Dec 2024 11:58:52 -0600 Subject: [PATCH 3/6] Fix: Update directives for ExtendedContext and DefaultContext, revert 'standard' terminology --- Doc/library/decimal.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index 0dfeb088227e35..8ef5565baa2ba7 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1035,7 +1035,7 @@ described below. In addition, the module provides three pre-made contexts: .. data:: BasicContext - This is a standard context object defined by the General Decimal Arithmetic Specification. + This is a standard context defined by the General Decimal Arithmetic Specification. Precision is set to nine. Rounding is set to :const:`ROUND_HALF_UP`. All flags are cleared. All traps are enabled (treated as exceptions) except :const:`Inexact`, :const:`Rounded`, and From 7a7fec1e64cfd5b7a0f544ecf236abdb92413cb0 Mon Sep 17 00:00:00 2001 From: abkmystery Date: Tue, 31 Dec 2024 12:02:07 -0600 Subject: [PATCH 4/6] Fix: Update directives for ExtendedContext and DefaultContext, revert 'standard' terminology --- Doc/library/decimal.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index 8ef5565baa2ba7..185eaf3f721c72 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1035,8 +1035,8 @@ described below. In addition, the module provides three pre-made contexts: .. data:: BasicContext - This is a standard context defined by the General Decimal Arithmetic Specification. - Precision is set to nine. Rounding is set to + This is a standard context defined by the General Decimal Arithmetic + Specification. Precision is set to nine. Rounding is set to :const:`ROUND_HALF_UP`. All flags are cleared. All traps are enabled (treated as exceptions) except :const:`Inexact`, :const:`Rounded`, and :const:`Subnormal`. From c1a8abaf064a0b500ade48a3328baecc8c8cc6bb Mon Sep 17 00:00:00 2001 From: abkmystery Date: Tue, 31 Dec 2024 21:25:39 -0600 Subject: [PATCH 5/6] Replace :class: with :data: for DefaultContext, BasicContext, and ExtendedContext in documentation --- Doc/whatsnew/3.3.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index f814c4e90d5719..1a3f3fdf330c88 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -1147,8 +1147,8 @@ API changes | :const:`MIN_EMIN` | ``-425000000`` | ``-999999999999999999`` | +-------------------+----------------+-------------------------+ -* In the context templates (:class:`~decimal.DefaultContext`, - :class:`~decimal.BasicContext` and :class:`~decimal.ExtendedContext`) +* In the context templates (:data:`~decimal.DefaultContext`, + :data:`~decimal.BasicContext` and :data:`~decimal.ExtendedContext`) the magnitude of :attr:`~decimal.Context.Emax` and :attr:`~decimal.Context.Emin` has changed to ``999999``. From 82379f1733a2ac93d623d76d66f5aa724edeeaf9 Mon Sep 17 00:00:00 2001 From: abkmystery Date: Wed, 1 Jan 2025 08:05:28 -0600 Subject: [PATCH 6/6] Update Doc/whatsnew/3.3.rst from :data: to :const: as suggested --- Doc/whatsnew/3.3.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index 1a3f3fdf330c88..7a8eb47cbdb354 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -1147,8 +1147,8 @@ API changes | :const:`MIN_EMIN` | ``-425000000`` | ``-999999999999999999`` | +-------------------+----------------+-------------------------+ -* In the context templates (:data:`~decimal.DefaultContext`, - :data:`~decimal.BasicContext` and :data:`~decimal.ExtendedContext`) +* In the context templates (:const:`~decimal.DefaultContext`, + :const:`~decimal.BasicContext` and :const:`~decimal.ExtendedContext`) the magnitude of :attr:`~decimal.Context.Emax` and :attr:`~decimal.Context.Emin` has changed to ``999999``.