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

Upper bound protobuf containers based on scalar/composite #5787

Merged
merged 1 commit into from
Jul 16, 2021

Conversation

nipunn1313
Copy link
Contributor

Noticed that protobuf containers (repeated lists and maps) are bifurcated into scalar/composite, but mypy treats them identically. Here we can leverage upper bounds to further enforce the subtypes allowable by proto (primitive types / message types)

Map Keys are limited to ints and strings per https://developers.google.com/protocol-buffers/docs/proto#maps

@JelleZijlstra JelleZijlstra merged commit 5199ed5 into python:master Jul 16, 2021
@nipunn1313 nipunn1313 deleted the limit_containers branch July 16, 2021 20:16
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