diff --git a/CHANGES.rst b/CHANGES.rst index 88f5c631..139376d0 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 0049f971..b66627d2 100644 --- a/pyasn1/type/constraint.py +++ b/pyasn1/type/constraint.py @@ -454,7 +454,7 @@ class Item(Sequence): # Set is similar OptionalNamedType('id', Integer()), OptionalNamedType('name', OctetString()) ) - withComponents = ConstraintsIntersection( + withComponents = ConstraintsUnion( WithComponentsConstraint( ('id', ComponentPresentConstraint()), ('name', ComponentAbsentConstraint()) @@ -471,9 +471,11 @@ class Item(Sequence): # Set is similar 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' """