Python
Python copied to clipboard
`maths\jaccard_similarity.py` does not validate input and can divide by zero
Repository commit
51dba4d743cd2c8d407eea3e9cd4e7b2f69ee34d
Python version (python --version)
Python 3.10.2
Dependencies version (pip freeze)
pip==22.2.2 setuptools==60.10.0 wheel==0.37.1
Expected behavior
According to CONTRIBUTING.md
, a ValueError
should be raised in the case of erroneous input.
Actual behavior
This code makes no effort to check the input, and this can result in a zero division when given empty lists as input:
what do you want to return from the function when the length of union set is 0 ? assign me i will add a validating condition
Please don't beg me to assign you. I am handling this myself.
Hell, you probably didn't even read my issue message, nor did you read CONTRIBUTING.md
.
That commit does not solve the issue!
Hello, Can you assign this issue to me?
No, go away, spambot.