diff options
-rw-r--r-- | CHANGES.rst | 2 | ||||
-rw-r--r-- | pyasn1/type/constraint.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 88f5c63..139376d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,5 +1,5 @@ -Revision 0.4.7, released XX-09-2019 +Revision 0.4.7, released 01-09-2019 ----------------------------------- - Added `isInconsistent` property to all constructed types. This property diff --git a/pyasn1/type/constraint.py b/pyasn1/type/constraint.py index 0049f97..b66627d 100644 --- a/pyasn1/type/constraint.py +++ b/pyasn1/type/constraint.py @@ -454,7 +454,7 @@ class WithComponentsConstraint(AbstractConstraint): OptionalNamedType('id', Integer()), OptionalNamedType('name', OctetString()) ) - withComponents = ConstraintsIntersection( + withComponents = ConstraintsUnion( WithComponentsConstraint( ('id', ComponentPresentConstraint()), ('name', ComponentAbsentConstraint()) @@ -471,9 +471,11 @@ class WithComponentsConstraint(AbstractConstraint): item['id'] = 1 # This will succeed + item.reset() item['name'] = 'John' - # This will fail on encoding + # This will fail (on encoding) + item.reset() descr['id'] = 1 descr['name'] = 'John' """ |