Skip to content

Commit 2299c43

Browse files
decimal: kwargs to localcontext() (#7686)
1 parent e833b5a commit 2299c43

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

stdlib/_decimal.pyi

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,23 @@ class FloatOperation(DecimalException, TypeError): ...
5252

5353
def setcontext(__context: Context) -> None: ...
5454
def getcontext() -> Context: ...
55-
def localcontext(ctx: Context | None = ...) -> _ContextManager: ...
55+
56+
if sys.version_info >= (3, 11):
57+
def localcontext(
58+
ctx: Context | None = ...,
59+
*,
60+
prec: int | None = ...,
61+
rounding: str | None = ...,
62+
Emin: int | None = ...,
63+
Emax: int | None = ...,
64+
capitals: int | None = ...,
65+
clamp: int | None = ...,
66+
traps: dict[_TrapType, bool] | None = ...,
67+
flags: dict[_TrapType, bool] | None = ...,
68+
) -> _ContextManager: ...
69+
70+
else:
71+
def localcontext(ctx: Context | None = ...) -> _ContextManager: ...
5672

5773
class Decimal:
5874
def __new__(cls: type[Self], value: _DecimalNew = ..., context: Context | None = ...) -> Self: ...

0 commit comments

Comments
 (0)