pylint #6708 detecting when it's safe to ignore builtin overrides [open]

skip wrote...

SpamBayes tries to work on versions of Python as old as 2.2. Accordingly, we put code in to make sure some potentially missing symbols are checked and set if necessary:

    True, False
except NameError:
    # Maintain compatibility with Python 2.2
    True, False = 1, 0

If I pylint this code using a version of Python which does support True & False (actually, Python 2.2 acquired those symbols sometime during the 2.2 lifetime) it complains about overriding True and False. It would be nice if pylint could detect this sort of construct. 'try' something. If there is an 'except NameError' clause, pretend for the duration of that clause that any builtin symbols referenced in the try clause really don't exist (even though they might well exist in the version of Python being run) so that the statements in the except clause don't trigger complaints about the override.

done in<not specified>
load left0.500
closed by<not specified>