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 support for messages/enums with python reserved keyword names #227

Closed
nipunn1313 opened this issue Jul 7, 2021 · 0 comments · Fixed by #250
Closed

Improve support for messages/enums with python reserved keyword names #227

nipunn1313 opened this issue Jul 7, 2021 · 0 comments · Fixed by #250

Comments

@nipunn1313
Copy link
Owner

See #221 for discussion

message None {
    string field = 1;
}
message M {
    None none = 1;
}

Currently, mypy-protobuf does not generate stubs for None and generates a field accessor

class M:
  @property
  def none() -> Any

We can improve this to

class None_:
    ...

class M:
    @property
    def none() -> None_

This will allow accessors to such messages improved typing

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 a pull request may close this issue.

1 participant