segmentation.evaluation
segmentation.evaluation copied to clipboard
assert len(window) is window_size + 1 for equal numbers
Hello,
I would like to report wrong usage of assert x is y
line:
https://github.com/cfournie/segmentation.evaluation/blob/master/segeval/window/windowdiff.py
line 110
assert len(window) is window_size + 1
fails.
It should be enough to have
assert len(window) == window_size + 1
Examples (python2.7.6):
>>> assert 3 is 2 + 1
>>> assert 300 is 299 + 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AssertionError
>>> id(300)
17688624
>>> id(299 + 1)
17688456
>>> id(1 + 299)
17688600
https://stackoverflow.com/a/2239753/3447343