soachishti / moss.py

Python client for Moss: A System for Detecting Software Similarity
MIT License
381 stars 75 forks source link

Moved static variables to instance variables #1

Closed nareddyt closed 6 years ago

nareddyt commented 6 years ago

Variables declared outside the constructor are not instance variable, they are static to the class instead. That means that new instances of your library will have duplicate data.

For example, out students worked on two files. I wanted to send moss requests for each type of file separately, so I made two instances of your library. However, any files I added to one instance was duplicated in the other instance.

This should fix that issue.

recluze commented 6 years ago

Haven't gone through the fix but can confirm the problem. Been seeing this in prod myself.

soachishti commented 6 years ago

Merged.

Thanks for this fix.