pg_utils.numerics.symparser.Gmpy2Printer

class pg_utils.numerics.symparser.Gmpy2Printer(settings=None, dps: Optional[int] = None, prec: Optional[int] = None)[source]

Bases: PythonCodePrinter

Lambda printer for gmpy2 which maintains precision for floats

__init__(settings=None, dps: Optional[int] = None, prec: Optional[int] = None)[source]

Methods

__init__([settings, dps, prec])

doprint(expr[, assign_to])

Print the expression as code.

emptyPrinter(expr)

parenthesize(item, level[, strict])

set_global_settings(**settings)

Set system-wide printing settings.

stringify(args, sep[, level])

Attributes

language

modules

order

printmethod

reserved_words

tab

doprint(expr, assign_to=None)[source]

Print the expression as code.

exprExpression

The expression to be printed.

assign_toSymbol, string, MatrixSymbol, list of strings or Symbols (optional)

If provided, the printed code will set the expression to a variable or multiple variables with the name or names given in assign_to.

classmethod set_global_settings(**settings)[source]

Set system-wide printing settings.