add type hints to comtypes/__init__.py
#364
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
related to #327
This PR introduces type hints into statically defined modules.
import
s are now grouped together at the beginning of the code.add_metaclass
, it was moved where "if it was imported fromsix
, it would be about here."typing
usingTYPE_CHECKING
, soList
,Tuple
and others are not in the runtime namespace._IUnknown_Base
, whose definition exists in runtime, is prevented from being used ingen
by add__known_symbols__
attributes to each modules for preventing unexpected symbols are imported tocomtypes.gen._xxx...
#360.AnnoField
inhints.pyi
. This can be used only underif TYPE_CHECKING
.In order to add more type annotations in the future, there are more symbols imported from
typing
than I use this time.import
part over and over.