comtypes
comtypes copied to clipboard
add `for_stub` mode to `ImportedNamespaces.getvalue`
related to #327
why is it necessary for_stub mode?
If we write from ham import Spam in the runtime module foo.py to add Spam to the namespace of the module, we must write from ham import Spam as Spam in the stub foo.pyi, otherwise an error will raise like "Spam" is not a known member of the module"(in the case of pylance) when we referenced it as foo.Spam.
Also, in the generated code, only the import part was line-breaking with \, so we unified it with the others and made it line-breaking with () and ,.