Feature or enhancement
There is no easy way to get a copy of a decimal.Context with some fields changed: Context.copy() takes no arguments, and the Context constructor takes unspecified fields from DefaultContext, not from an existing context.
I propose to support copy.replace():
ctx = copy.replace(decimal.getcontext(), prec=50)
Fields which are not specified keep the values they have in the original context. As in the constructor, flags and traps can be specified as a list of signals.
Linked PRs
Feature or enhancement
There is no easy way to get a copy of a
decimal.Contextwith some fields changed:Context.copy()takes no arguments, and theContextconstructor takes unspecified fields fromDefaultContext, not from an existing context.I propose to support
copy.replace():Fields which are not specified keep the values they have in the original context. As in the constructor, flags and traps can be specified as a list of signals.
Linked PRs