c2nes / javalang

Pure Python Java parser and tools
MIT License
736 stars 161 forks source link

Node __equals__ not reflexive #19

Closed sdjespersen closed 9 years ago

sdjespersen commented 9 years ago

I'm a bit confused by these two lines. Shouldn't this instead read

if type(other) is not type(self):
    return False

with a not in there? Consider the following:

tree = javalang.parse.parse('')
tree.__equals__(tree) # returns False
dbaxa commented 9 years ago

@sdjespersen that certainly seems the case to me. Feel free to raise a pull request to fix the issue.

c2nes commented 9 years ago

@sdjespersen Thanks for the heads up! Just pushed a fix. Let me know if you find any other problems and feel free to open a pull request (or issue) if you have ideas for anything that could be added/improved.