-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add fields/interfaces for the numeric tower #49
Labels
Comments
jamadden
added a commit
that referenced
this issue
Aug 30, 2018
In descending order of generality these are ``Number``, ``Complex``, ``Real``, ``Rational`` and ``Integral``. The ``Int`` class extends ``Integral``, the ``Float`` class extends ``Real``, and the ``Decimal`` class extends ``Number``. Generalize the parsing of numbers in the Number class. Add tests and document them. Run the field and bootstrap field doctests as part of unittesting, not just under tox with sphinx, and make them run on both Python 2 and 3. Fixes #49
jamadden
added a commit
that referenced
this issue
Aug 31, 2018
In descending order of generality these are ``Number``, ``Complex``, ``Real``, ``Rational`` and ``Integral``. The ``Int`` class extends ``Integral``, the ``Float`` class extends ``Real``, and the ``Decimal`` class extends ``Number``. Generalize the parsing of numbers in the Number class. Add tests and document them. Run the field and bootstrap field doctests as part of unittesting, not just under tox with sphinx, and make them run on both Python 2 and 3. Fixes #49
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similar to #11 and its implementation in #47 where we added fields and interfaces for
collections.Sequence
,collections.MutableSequence
,collections.Mapping
andcollections.MutableMapping
, I think it makes sense to have fields and interfaces fornumbers.Number
,numbers.Real
,numbers.Rational
andnumbers.Integral
.In our own usage, we commonly parse data from JSON, and depending on the browser/client, we can get floats or ints for the same field, so we use a
Number
field that allowsnumbers.Number
. But it's badly specified, what we really want is anumbers.Real
field.The text was updated successfully, but these errors were encountered: