Skip to content

Conversation

@felixxm
Copy link
Member

@felixxm felixxm commented Nov 17, 2025

@felixxm felixxm force-pushed the issue-26459-context branch from a9d9cea to 503cc8b Compare November 17, 2025 15:40
@felixxm felixxm force-pushed the issue-26459-context branch from 503cc8b to 997226c Compare November 17, 2025 18:00
@felixxm felixxm marked this pull request as ready for review November 17, 2025 20:30
decimal_imports = ", ".join(sorted(decimal_imports))
return repr(self.value), {
f"from decimal import {self.value.rounding}, {decimal_imports}"
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Context representation always has rounding and traps both defined by constants and exceptions from the decimal module:

>>> from decimal import Context
>>> Context()
Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999, capitals=1, clamp=0, flags=[], traps=[InvalidOperation, DivisionByZero, Overflow])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant