I'm trying to understand another author's code for writing a Parser in the "NAND to Tetris" project but don't understand what they mean when using the "<>" operators as shown in this chunk of code. I have included their constructor for reference to the self.commands function.
self.fname = fname
self.commands = open(fname, 'r').readlines()
"""Return True if more commands to parse else return False"""
return self.commands <> [ ]
In Python 2.X,
<> is same as
!= but the usage is obsolete and is discouraged in favour of the newer usage which is
Refer the manual for the Comparision section
return self.commands <> [ ] is same as
return self.commands != [ ] which means the self.commands is not an empty list which as per your docstring
Return True if more commands to parse else return False