Skip to content

Run mpmath as module (for interactive work)? #765

@skirpichev

Description

@skirpichev

The mpmath is a library, but I bet some people use it as a mp-calculator. Could we provide more useful interface for interactive work? I think so.

I'll suggest diofant-like interface: https://diofant.readthedocs.io/en/latest/cli.html (which is more or less an equivalent of the isympy script, but uses more robust methods of transformation for code). Given this, per default we could have in python -m mpmath shell something like that:

  • from mpmath import * namespace
  • integer division (most hateful Python feature) will be transformed to a Fraction (see ensure "gotchas" are easy to find and link to #677) or to accurate mpmath's value (mpf(numerator)/denominator)
  • float and complex literals will be transformed to mpf/mpc without truncation (i.e. 10.9 will be mpf('10.9'))

Does this make sense?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementnew feature requests (or implementation)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions