Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve xmlrpc.client callbacks #8188

Merged
merged 2 commits into from
Jun 27, 2022
Merged

Improve xmlrpc.client callbacks #8188

merged 2 commits into from
Jun 27, 2022

Conversation

AlexWaygood
Copy link
Member

@github-actions

This comment has been minimized.

stdlib/xmlrpc/client.pyi Outdated Show resolved Hide resolved
Comment on lines 103 to 104
# TODO: Replace 'Any' with some kind of binding
dispatch: dict[type[Any], Callable[[Marshaller, Any, _WriteType], None]]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just use _typeshed.Incomplete instead of Any, in case this is potentially fixable.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had a look at the source code writing this PR, and I get what the comment is saying, but I don't think it's really fixable tbh.

I'm wondering if we should introduce _typeshed.Inexpressible for cases like this, where we know what the type should be (so it's not incomplete per se), it's just that we don't currently have any way of expressing it in the current type system. It might also be useful for places where we really need recursive type aliases, but can't use them yet.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, Inexpressible is basically Any, at least if we use Incomplete consistently.

@github-actions
Copy link
Contributor

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

@AlexWaygood AlexWaygood merged commit 3e27458 into master Jun 27, 2022
@AlexWaygood AlexWaygood deleted the xmlrpc-callback branch June 27, 2022 12:22
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