Support for type hint?

When using pymongo, there is a package named pymongo-stubs to support type hint.
Now come to motor, for example, collection’s replace_one method returns Awaitable[UpdateResult] instead of UpdateResult.
Is there any way to make motor support type hint?
I have already googled “motor-stubs”, “motor type hint” etc. but there is likely no solution.
Copying files from pymongo-stubs and adding Awaitable works for me but is there a better solution?

Hi @Xuesong_Zhong

I think this question is better moved to the “Drivers & ODMs” category as I’m not familiar with the pymongo-stubs package as it is not part of our M220P course. I would recommend moving this question to that category and you will find a wider audience who are hopefully more familiar with that package.

Kindest regards,

We have not started working on type hints for motor yet. The ticket to watch is:

Thanks for reply and advice, I’m pretty new here and not very familiar with category and tag. And I’m sorry to post it in an inappropriate category.

Thanks for the information. Perhaps the only option currently is to write what I need by myself.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.