summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2019-08-28 10:02:35 +0200
committerIlya Etingof <etingof@gmail.com>2019-08-28 10:02:35 +0200
commit3cae125ac526f614021274337b5992a418191ab8 (patch)
tree7a96481cbb318d0d3a016ea6bc19048f4c70f559
parentd0b7f2ec8677eec8f9aa31103a66f5cab18e9308 (diff)
downloadpyasn1-git-3cae125ac526f614021274337b5992a418191ab8.tar.gz
Add an afterthought on WITH COMPONENTS constraint
-rw-r--r--pyasn1/type/constraint.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/pyasn1/type/constraint.py b/pyasn1/type/constraint.py
index b8aa0af..0049f97 100644
--- a/pyasn1/type/constraint.py
+++ b/pyasn1/type/constraint.py
@@ -411,12 +411,12 @@ class ComponentAbsentConstraint(AbstractConstraint):
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.
@@ -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
--------