Skip to content
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

assert len(window) is window_size + 1 for equal numbers #6

Open
janrygl opened this issue May 29, 2016 · 1 comment
Open

assert len(window) is window_size + 1 for equal numbers #6

janrygl opened this issue May 29, 2016 · 1 comment

Comments

@janrygl
Copy link

janrygl commented May 29, 2016

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
@janrygl janrygl changed the title assert len(window) is window_size + 1 for equal numbers (use == instead of is) assert len(window) is window_size + 1 for equal numbers May 29, 2016
@michal-au
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants