8000 decimal: kwargs to localcontext() by JelleZijlstra · Pull Request #7686 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

decimal: kwargs to localcontext() #7686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
-->
Diff view
18 changes: 17 additions & 1 deletion stdlib/_decimal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
0