Skip to content

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
Contributor

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

@lovelydinosaur lovelydinosaur merged commit 88c80fe into encode:master Apr 27, 2016
@lovelydinosaur
Copy link
Contributor

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