Skip to content

Commit

Permalink
Add an afterthought on WITH COMPONENTS constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
etingof committed Aug 28, 2019
1 parent d0b7f2e commit 3cae125
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pyasn1/type/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,12 @@ def _testValue(self, value, idx):
class WithComponentsConstraint(AbstractConstraint):
"""Create a WithComponentsConstraint object.
The WithComponentsConstraint satisfies any mapping object that has
The `WithComponentsConstraint` satisfies any mapping object that has
constrained fields present or absent, what is indicated by
`ComponentPresentConstraint` and `ComponentAbsentConstraint`
objects respectively.
The WithComponentsConstraint object is typically applied
The `WithComponentsConstraint` object is typically applied
to :class:`~pyasn1.type.univ.Set` or
:class:`~pyasn1.type.univ.Sequence` types.
Expand All @@ -426,6 +426,16 @@ class WithComponentsConstraint(AbstractConstraint):
Zero or more tuples of (`field`, `constraint`) indicating constrained
fields.
Notes
-----
On top of the primary use of `WithComponentsConstraint` (ensuring presence
or absence of particular components of a :class:`~pyasn1.type.univ.Set` or
:class:`~pyasn1.type.univ.Sequence`), it is also possible to pass any other
constraint objects or their combinations. In case of scalar fields, these
constraints will be verified in addition to the constraints belonging to
scalar components themselves. However, formally, these additional
constraints do not change the type of these ASN.1 objects.
Examples
--------
Expand Down

0 comments on commit 3cae125

Please sign in to comment.