Skip to content

Commit af31b21

Browse files
decimal: kwargs to localcontext()
python/cpython#32242
1 parent 3a98e8b commit af31b21

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

stdlib/_decimal.pyi

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

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

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

0 commit comments

Comments
 (0)