Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decimal.Decimal type support in RPC #58

Open
Alerion opened this issue Aug 24, 2015 · 0 comments
Open

decimal.Decimal type support in RPC #58

Alerion opened this issue Aug 24, 2015 · 0 comments

Comments

@Alerion
Copy link

Alerion commented Aug 24, 2015

Is Decimal not supported by design? I have fixed this with value translator:

import msgpack
from decimal import Decimal

translation_table = {
    0: (Decimal,
        lambda value: msgpack.packb(str(value)),
        lambda binary: Decimal(msgpack.unpackb(binary).decode())),
}

And it does not throw any error if conversion failed. Look like it just hags on the call.

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

No branches or pull requests

1 participant