otherwise `not NotImplemented` (always False) is returned from __ne__ when `type(self) != type(other)`, leading to illogic results like:
>>> from fontTools.ttLib.tables.DefaultTable import DefaultTable
>>> t = DefaultTable('test')
>>> t == 0
False
>>> t != 0
False
The latter of course should return True.
Ie, now we get:
...
assert 0 <= value < 0x10000, value
AssertionError: (None, 'LookupListIndex', 'SubstLookupRecord[0]', 'ChainContextSubst[1]', 'Lookup[3]', 'LookupList')
The common stacktrace like this:
File "fonttools/Lib/fontTools/ttLib/__init__.py", line 202, in save
self._writeTable(tag, writer, done)
File "fonttools/Lib/fontTools/ttLib/__init__.py", line 631, in _writeTable
tabledata = self.getTableData(tag)
File "fonttools/Lib/fontTools/ttLib/__init__.py", line 644, in getTableData
return self.tables[tag].compile(self)
File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 86, in compile
self.table.compile(writer, font)
File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 681, in compile
conv.write(writer, font, table, value)
File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 354, in write
value.compile(subWriter, font)
File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 661, in compile
conv.write(writer, font, table, value, i)
File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 354, in write
value.compile(subWriter, font)
File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 661, in compile
conv.write(writer, font, table, value, i)
File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 354, in write
value.compile(subWriter, font)
File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 661, in compile
conv.write(writer, font, table, value, i)
File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 277, in write
value.compile(writer, font)
File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 681, in compile
conv.write(writer, font, table, value)
File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 175, in write
writer.writeUShort(value)
File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 457, in writeUShort
assert 0 <= value < 0x10000, value
AssertionError: None
now has this as the last line:
AssertionError: (None, 'LookupListIndex', 'SubstLookupRecord', 'ChainContextSubst', 'Lookup', 'LookupList')
which means a value of None was tried for writing a LookupListIndex from a ChainContextSubset...
It's a hack, but a very useful one.
This reverts commit d8803873f6d4efbcb227867fe0ac6bca370597bc.
The commit wasn't fully correct as it was not installing properties
for counts in format-switching subtables.
Before, equivalent types, eg. otTables.BacktrackCoverage, etc,
where a subclass of their equivalent parent type, eg. otTables.Coverage
With this change, they are the same type.
The otBase and otConverters changes were needed to make the above
happen and still generate correct XML for SubTable type.
Also removing unused stats collection. The need for setting up
an object to collect these (unused) stats made it hard to write
tests on code that called OTTableReader.getSubReader().
The latter hits the __eq__ method and can fail because we now
do not allow comparing objects of different types.
For example, was failing subsetting Andika-R.ttf.