In the check_date function, there are lines of code here, here,here, and here that compare integers with string using a value comparison. The date attribute of the NounPhrase class and its Phrase superclass are strings. These lines don't throw errors in Python2 but they do in Python3.
Also, I'm not sure it works as intended. When going through the test_noun_meaning1 test, we see the following conflict.
>>> '081315' >= int('150578')
True
>>> int('081315') >= int('150578')
False
Here is the output of Python3
>>> '081315' >= int('150578')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '>=' not supported between instances of 'str' and 'int'
>>> int('081315') >= int('150578')
False
What should the expected behavior be here?
It looks like we should be comparing the dstr_to_ordate(curdate) to the integer date. Here the dstr_to_ordate.
In the
check_datefunction, there are lines of code here, here,here, and here that compare integers with string using a value comparison. Thedateattribute of theNounPhraseclass and itsPhrasesuperclass are strings. These lines don't throw errors in Python2 but they do in Python3.Also, I'm not sure it works as intended. When going through the
test_noun_meaning1test, we see the following conflict.Here is the output of Python3
What should the expected behavior be here?
It looks like we should be comparing the
dstr_to_ordate(curdate)to the integer date. Here the dstr_to_ordate.