-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix homogeneous sequence boundary #117
Conversation
@@ -28,9 +28,10 @@ class Vector( | |||
] | |||
): | |||
def __init__(self, element_sedes: TSedes, length: int) -> None: | |||
if length <= 0: | |||
if length < 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change here? Given that we are dealing with int
, <= 0
is equivalent to < 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's equivalent. I wanted to make it more clear and follow the error message more tightly.
3da1d46
to
d5a922a
Compare
What was wrong?
Address issue #116
How was it fixed?
HomogeneousProperCompositeSedes.__init_()
Vector
andBitvector
)__init__()
with illegal conditionmax_length < 1
.List
andBitlist
)__init__()
with illegal conditionmax_length < 0
.ValueError
for these exceptions.test_homogeneous_sequence_length_boundary
andtest_bitfield_length_boundary
Cute Animal Picture
/cc @booleanfunction @saltiniroberto