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
* Overload __new__
Mypy can't handle a large number of generic overloads (python/mypy#19622) so instead generate 2 different stub classes and override __new__. Seems to have the same functionality, without the generics overhead. Minor feature change in the revealed type of a stub class.
Signed-off-by: Aidan Jensen <aidandj.github@gmail.com>
* Write union methods to main typestub. Add
Signed-off-by: Aidan Jensen <aidandj.github@gmail.com>
* Clean up generated code and readme
* Document async usage
* Add tests for async/sync attribute usage
* Generate sync methods by default, and type ignore async override for new override
Signed-off-by: Aidan Jensen <aidandj.github@gmail.com>
* Fix missing method comment regression
Signed-off-by: Aidan Jensen <aidandj.github@gmail.com>
---------
Signed-off-by: Aidan Jensen <aidandj.github@gmail.com>
result =await stub.UnaryUnary(dummy_pb2.DummyRequest(value="cprg"))
383
+
typing.assert_type(result, dummy_pb2.DummyReply)
384
+
```
385
+
386
+
If you need to explicitly type something as an async stub (class attr, etc) then you must use deferred annotations, and the async stub, as it does not exist at runtime.
result =awaitself.stub.UnaryUnary(dummy_pb2.DummyRequest(value="cprg"))
397
+
typing.assert_type(result, dummy_pb2.DummyReply)
398
+
```
399
+
374
400
### `_ClearFieldArgType`, `_WhichOneofArgType_<oneof_name>`, `_WhichOneofReturnType_<oneof_name>` and `_HasFieldArgType` aliases
375
401
376
402
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:
0 commit comments