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

@dvarrazzo dvarrazzo commented Apr 27, 2016

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

jpadilla commented Apr 27, 2016

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

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

tomchristie commented Apr 27, 2016

Good stuff 👍

@glarrain
Copy link
Contributor

glarrain commented Nov 29, 2016

@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.

None yet

4 participants