vlasovskikh / funcparserlib

Recursive descent parsing library for Python based on functional combinators
https://funcparserlib.pirx.ru
MIT License
338 stars 38 forks source link

Fixes bug in equality operator in Token class #58

Closed dipietrantonio closed 3 years ago

dipietrantonio commented 5 years ago

Currently, equality operator (==) in class Token doesn't check if the argument other is None, leading to the exception

AttributeError: 'NoneType' object has no attribute 'type'

This pull request fixes the bug by returning False if other is None

vlasovskikh commented 3 years ago

@Halolegend94 Thanks for your pull request! I've rebased it as 846b719cfd5d8289e969be5f8abc3e750ccb75c6. I've also added a unit test, see f489471fadfced016870e54709700af4c4f31ad3.