Skip to content

[pywin32] Improve win32com#15527

Open
donbarbos wants to merge 2 commits intopython:mainfrom
donbarbos:win32com-improve
Open

[pywin32] Improve win32com#15527
donbarbos wants to merge 2 commits intopython:mainfrom
donbarbos:win32com-improve

Conversation

@donbarbos
Copy link
Contributor

  • Add Final
  • Add default values
  • Use bool | Literal[0, 1] for boolean params (instead of int)
  • Annotate known parts

(Source: https://github.com/mhammond/pywin32/tree/b311/com/win32com)

* Add `Final`
* Add default values
* Use `bool | Literal[0, 1]` for boolean params (instead of `int`)
* Annotate known parts

(Source: https://github.com/mhammond/pywin32/tree/b311/com/win32com)
Comment on lines +12 to 13
@type_check_only
class _DispatchCreateClass(Protocol[_T_co]):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @brianschubert I didn’t find any occurrences of this name in the source code (via grep), so I thought this case might also be interesting for your stubtest patch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is covered by an allowlist entry, which is why it hasn't been flagged yet:

# "dynamic.CDipatch" is necessary for mypy to not throw AssertionError
win32com.client.dynamic.*

Maybe you can refine that while we're here?

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants