Comments (3)
Great bugreport! Thanks.
I don't know offhand how we're supposed to type a variable with a reserved keyword name. Will look into it w/ mypy docs / folks. Thanks for reporting!
from mypy-protobuf.
I'd not emit them. See also https://developers.google.com/protocol-buffers/docs/reference/python-generated#keyword-conflicts
from mypy-protobuf.
It looks like the .py file generator sidesteps the issue by not generating Python code but some meta thing. So at runtime you'd have to write getattr(thing, 'from')
. (And add # noqa
:-)
Since there can't be any code that writes thing.from
, maybe the simplest thing would be to just not emit the field at all? Or perhaps emit it with a #
in front of it?
from mypy-protobuf.
Related Issues (20)
- enums: argument has incompatible type "int"; expected "ValueType" HOT 2
- Compare mypy-protobuf to protobuf --pyi_out support (starting with 3.20) HOT 7
- Use official style for generated stubs HOT 5
- Reserve extension numbers within the protobuf global extension registry
- flake8-noqa reports unused `noqa` comments in generated protobuf stubs HOT 3
- Library stubs not installed for "google.protobuf.service_reflection" HOT 4
- my-protobuf-3.4.0 breaks backward compatibility by silently upgrading to protobuf-4 HOT 10
- Add version to header comment. HOT 3
- No module named mypy_protobuf HOT 8
- Not generating .py files from protouf file using this plugin HOT 1
- Question: why not use Python’s Enum HOT 11
- Get generated code to be black-compatible for readability
- Compatibility with flake8-pyi>=23.5.0 HOT 1
- timeout should be float HOT 2
- Release version on pypi is to low! HOT 2
- A better way to annotation the AsyncStub HOT 9
- Document the experience on configuring properly with Visual Studio Code HOT 1
- Fix github actions warnings
- Add error code to bare type ignore
- Ignoring field names equal to reserved keywords like "from" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mypy-protobuf.