comtypes icon indicating copy to clipboard operation
comtypes copied to clipboard

remove `CodeGenerator.need_GUID`

Open junkmd opened this issue 3 years ago • 0 comments

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.

junkmd avatar Sep 29 '22 11:09 junkmd