decimal: kwargs to localcontext() (#7686)

This commit is contained in:
Jelle Zijlstra
2022-04-26 04:19:29 -07:00
committed by GitHub
parent e833b5a095
commit 2299c43860

View File

@@ -52,7 +52,23 @@ class FloatOperation(DecimalException, TypeError): ...
def setcontext(__context: Context) -> None: ...
def getcontext() -> Context: ...
def localcontext(ctx: Context | None = ...) -> _ContextManager: ...
if sys.version_info >= (3, 11):
def localcontext(
ctx: Context | None = ...,
*,
prec: int | None = ...,
rounding: str | None = ...,
Emin: int | None = ...,
Emax: int | None = ...,
capitals: int | None = ...,
clamp: int | None = ...,
traps: dict[_TrapType, bool] | None = ...,
flags: dict[_TrapType, bool] | None = ...,
) -> _ContextManager: ...
else:
def localcontext(ctx: Context | None = ...) -> _ContextManager: ...
class Decimal:
def __new__(cls: type[Self], value: _DecimalNew = ..., context: Context | None = ...) -> Self: ...