comtypes
comtypes copied to clipboard
remove `CodeGenerator.need_GUID`
The GUID symbol is defined statically in comtypes/__init__.py, so it is always existing in comtypes module namespace.
Therefore, if "GUID" in self.known_symbols: in CodeGenerator.need_GUID was always True. It was a redundant process.
So I have removed the need_GUID method and instead use self.imports.add("comtypes", "GUID") which is more concise and does the same thing.
This is a refactoring of the codegenerator before adding the stub generation process and is related to #327.