shabbyrobe / grpc-stubs

gRPC typing stubs for Python
MIT License
36 stars 21 forks source link

Argument `grace` of Server.stop() should be Optional[float] #6

Closed adriansahlman closed 4 years ago

adriansahlman commented 4 years ago

Hey, thanks for making this stub. Has been super useful for me!

I was looking into what type to use for the argument grace of Server.stop() when creating a delegate and to figure it out I took a peek at the gRPC source code for python. The only place that this argument is used seems to be here. It is passed to threading.Event.wait() which according to the docs takes an optional floating point number.

So I believe the correct type for the argument should be typing.Optional[float].

Cheers!

shabbyrobe commented 4 years ago

That looks right, yep! Thanks for the report, v1.24.2 has been uploaded to pypi with the fix. Much appreciated!