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

Fixed DecimalField arbitrary precision support #4075

Merged
merged 1 commit into from
Apr 27, 2016

Conversation

dvarrazzo
Copy link
Contributor

DecimalField has some support for non strict number of decimal places (checking here and there that decimal_places is not None but it fails in quantize() with "unsupported operand type(s) for ** or pow(): 'Decimal' and 'NoneType'".

This changeset fixes the problem and allows DecimalField to handle decimal_places=None. Tests added too.

@jpadilla jpadilla added this to the 3.3.4 Release milestone Apr 27, 2016
@jpadilla
Copy link
Member

@dvarrazzo good stuff, thanks! Anyone else has any objections/comments?

@tomchristie tomchristie merged commit 88c80fe into encode:master Apr 27, 2016
@tomchristie
Copy link
Member

Good stuff 👍

@glarrain
Copy link
Contributor

@dvarrazzo @jpadilla @tomchristie is decimal_places=None allowed then? We should update the docs to make that clear (I volunteer to do so).

On the other hand, why are args decimal_places and max_digits required then? As mentioned by @xordoquy here, those that are not kwargs to __init__ are supposed to be required (because they can not be set to a default value).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants