You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,7 @@ See [Changelog](CHANGELOG.md) for full listing
101
101
*`mypy-protobuf` generates correctly typed constructors dependinding on field presence.
102
102
*`mypy-protobuf` generates correctly typed `HasField`, `WhichOneof`, and `ClearField` methods.
103
103
* There are differences in how `mypy-protobuf` and `pyi_out` generate enums. See [this issue](https://github.com/protocolbuffers/protobuf/issues/8175) for details
104
+
* Type aliases exported for `HasField`, `WhichOneof` and `ClearField` arguments
104
105
105
106
#### Examples
106
107
@@ -372,7 +373,7 @@ If you need stubs for grpc internal code we suggest using this package https://g
372
373
373
374
### `_ClearFieldNamesType` and `_HasFieldNamesType` aliases
374
375
375
-
Where applicable, type aliases are generated for the arguments to `ClearField` and `HasField`. These can be used to create typed functions for field manipulation:
376
+
Where applicable, type aliases are generated for the arguments to `ClearField`, `WhichOneof` and `HasField`. These can be used to create typed functions for field manipulation:
376
377
377
378
```python
378
379
from testproto.edition2024_pb2 import Editions2024Test
@@ -381,6 +382,14 @@ Where applicable, type aliases are generated for the arguments to `ClearField` a
Note the deferred evaluation (string reference, or `from __future__ import annotations`. This bypasses the fact that the alias does not exist on the stub)
0 commit comments