Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tarantool/tarantool-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 71559ad
Choose a base ref
...
head repository: tarantool/tarantool-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 45c5b34
Choose a head ref
  • 1 commit
  • 10 files changed
  • 1 contributor

Commits on Sep 5, 2022

  1. msgpack: support decimal extended type

    Tarantool supports decimal type since version 2.2.1 [1]. This patch
    introduced the support of Tarantool decimal type in msgpack decoders and
    encoders. The Tarantool decimal type is mapped to the native Python
    decimal.Decimal type.
    
    Tarantool decimal numbers have 38 digits of precision, that is, the
    total number of digits before and after the decimal point can be 38 [2].
    If there are more digits arter the decimal point, the precision is lost.
    If there are more digits before the decimal point, error is thrown. In
    fact, there is also an exceptional case: if decimal starts with `0.`,
    38 digits after the decimal point are supported without the loss of
    precision. msgpack encoder checks if everything is alright. If number is
    not a valid Tarantool decimal, the error is raised. If precision will be
    lost on conversion, warning is issued.
    
    Any Tarantool decimal could be converted to a Python decimal without the
    loss of precision. Python decimals have its own user alterable precision
    (defaulting to 28 places), but it's related only to arithmetic
    operations: we can allocate 38-placed decimal disregarding of what
    decimal module configuration is used [3].
    
    1. tarantool/tarantool#692
    2. https://www.tarantool.io/ru/doc/latest/reference/reference_lua/decimal/
    3. https://docs.python.org/3/library/decimal.html
    
    Closed #203
    DifferentialOrange committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    45c5b34 View commit details
    Browse the repository at this point in the history
Loading