Skip to content

Commit

Permalink
Merge pull request #50 from zopefoundation/issue49
Browse files Browse the repository at this point in the history
Add fields and interfaces matching the numeric tower.
  • Loading branch information
jamadden committed Aug 31, 2018
2 parents ff8f729 + dec22f5 commit 665e2e7
Show file tree
Hide file tree
Showing 8 changed files with 850 additions and 417 deletions.
10 changes: 10 additions & 0 deletions CHANGES.rst
Expand Up @@ -87,6 +87,16 @@
subclass, enabling a simpler constructor call. See `issue 23
<https://github.com/zopefoundation/zope.schema/issues/23>`_.

- Add fields and interfaces representing Python's numeric tower. 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``. See `issue 49
<https://github.com/zopefoundation/zope.schema/issues/49>`_.

- Make ``Iterable`` and ``Container`` properly implement ``IIterable``
and ``IContainer``, respectively.

4.5.0 (2017-07-10)
==================

Expand Down
56 changes: 36 additions & 20 deletions docs/api.rst
Expand Up @@ -41,6 +41,12 @@ Strings
Numbers
-------

.. autoclass:: zope.schema.interfaces.INumber
.. autoclass:: zope.schema.interfaces.IComplex
.. autoclass:: zope.schema.interfaces.IReal
.. autoclass:: zope.schema.interfaces.IRational
.. autoclass:: zope.schema.interfaces.IIntegral

.. autoclass:: zope.schema.interfaces.IInt
.. autoclass:: zope.schema.interfaces.IFloat
.. autoclass:: zope.schema.interfaces.IDecimal
Expand Down Expand Up @@ -141,16 +147,9 @@ Fields
.. autoclass:: zope.schema.Field
.. autoclass:: zope.schema.Collection
.. autoclass:: zope.schema._field.AbstractCollection
.. autoclass:: zope.schema.ASCII
:no-show-inheritance:
.. autoclass:: zope.schema.ASCIILine
:no-show-inheritance:

.. autoclass:: zope.schema.Bool
:no-show-inheritance:
.. autoclass:: zope.schema.Bytes
:no-show-inheritance:
.. autoclass:: zope.schema.BytesLine
:no-show-inheritance:
.. autoclass:: zope.schema.Choice
:no-show-inheritance:
.. autoclass:: zope.schema.Container
Expand All @@ -159,20 +158,14 @@ Fields
:no-show-inheritance:
.. autoclass:: zope.schema.Datetime
:no-show-inheritance:
.. autoclass:: zope.schema.Decimal
:no-show-inheritance:
.. autoclass:: zope.schema.Dict
.. autoclass:: zope.schema.DottedName
:no-show-inheritance:

.. autoclass:: zope.schema.Float
:no-show-inheritance:
.. autoclass:: zope.schema.FrozenSet
:no-show-inheritance:
.. autoclass:: zope.schema.Id
:no-show-inheritance:
.. autoclass:: zope.schema.Int
:no-show-inheritance:
.. autoclass:: zope.schema.InterfaceField
:no-show-inheritance:
.. autoclass:: zope.schema.Iterable
Expand All @@ -192,12 +185,6 @@ Fields
:no-show-inheritance:
.. autoclass:: zope.schema.Set
.. autoclass:: zope.schema.Sequence
.. autoclass:: zope.schema.SourceText
:no-show-inheritance:
.. autoclass:: zope.schema.Text
:no-show-inheritance:
.. autoclass:: zope.schema.TextLine
:no-show-inheritance:
.. autoclass:: zope.schema.Time
:no-show-inheritance:
.. autoclass:: zope.schema.Timedelta
Expand All @@ -206,6 +193,35 @@ Fields
.. autoclass:: zope.schema.URI
:no-show-inheritance:

Strings
-------
.. autoclass:: zope.schema.ASCII
:no-show-inheritance:
.. autoclass:: zope.schema.ASCIILine
:no-show-inheritance:
.. autoclass:: zope.schema.Bytes
:no-show-inheritance:
.. autoclass:: zope.schema.BytesLine
:no-show-inheritance:
.. autoclass:: zope.schema.SourceText
:no-show-inheritance:
.. autoclass:: zope.schema.Text
:no-show-inheritance:
.. autoclass:: zope.schema.TextLine
:no-show-inheritance:

Numbers
-------
.. autoclass:: zope.schema.Number
.. autoclass:: zope.schema.Complex
.. autoclass:: zope.schema.Real
.. autoclass:: zope.schema.Rational
.. autoclass:: zope.schema.Integral
.. autoclass:: zope.schema.Float
.. autoclass:: zope.schema.Int
.. autoclass:: zope.schema.Decimal


Accessors
=========

Expand Down
14 changes: 12 additions & 2 deletions src/zope/schema/__init__.py
Expand Up @@ -21,6 +21,7 @@
from zope.schema._field import BytesLine
from zope.schema._field import Choice
from zope.schema._field import Collection
from zope.schema._field import Complex
from zope.schema._field import Container
from zope.schema._field import Date
from zope.schema._field import Datetime
Expand All @@ -32,20 +33,24 @@
from zope.schema._field import FrozenSet
from zope.schema._field import Id
from zope.schema._field import Int
from zope.schema._field import Integral
from zope.schema._field import InterfaceField
from zope.schema._field import Iterable
from zope.schema._field import List
from zope.schema._field import Mapping
from zope.schema._field import MinMaxLen
from zope.schema._field import MutableMapping
from zope.schema._field import MutableSequence
from zope.schema._field import MinMaxLen
from zope.schema._field import NativeString
from zope.schema._field import NativeStringLine
from zope.schema._field import Number
from zope.schema._field import Object
from zope.schema._field import Orderable
from zope.schema._field import Password
from zope.schema._field import Set
from zope.schema._field import Rational
from zope.schema._field import Real
from zope.schema._field import Sequence
from zope.schema._field import Set
from zope.schema._field import SourceText
from zope.schema._field import Text
from zope.schema._field import TextLine
Expand Down Expand Up @@ -77,6 +82,7 @@
'BytesLine',
'Choice',
'Collection',
'Complex',
'Container',
'Date',
'Datetime',
Expand All @@ -88,6 +94,7 @@
'FrozenSet',
'Id',
'Int',
'Integral',
'InterfaceField',
'Iterable',
'List',
Expand All @@ -97,9 +104,12 @@
'MinMaxLen',
'NativeString',
'NativeStringLine',
'Number',
'Object',
'Orderable',
'Password',
'Rational',
'Real',
'Set',
'Sequence',
'SourceText',
Expand Down

0 comments on commit 665e2e7

Please sign in to comment.