Ah, the set() class-level assignment is a relic (you can see it's immediately overridden in __init__). The "__forbidden = set()" line can be removed. Currently, only 1 module is forbidden (either PySide or PyQt4), so assignment/`==` is fine.