Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improving and fix type hint #907

Closed
wants to merge 8 commits into from
Closed

improving and fix type hint #907

wants to merge 8 commits into from

Conversation

CAPITAINMARVEL
Copy link
Contributor

to be continued ...

@CAPITAINMARVEL
Copy link
Contributor Author

@roman-right apologise for the other pull request deleted i dont know well github 😅
I think for the type hint it works well only issue that im trying to fix is the type hint for the update things
its a bit confusing cause it need to be awaited or else it doesnt update anything in database.

However currently it wont warn the user about it if the user forget to await it, it will say on print something like
<beanie.odm.queries.find.FindOne object at 0x0000024B194D52B0>
But if we forget await a function python normal it would say
RuntimeWarning: coroutine 'testa' was never awaited
self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Cause for type hint it can be fixed using overload and async

@CAPITAINMARVEL
Copy link
Contributor Author

which can lead to error to the user so I dont know what should be done to fix that

@bedlamzd
Copy link
Contributor

bedlamzd commented Apr 3, 2024

@CAPITAINMARVEL did you just copy my pull request #886 and not even changed a thing in the commit? huh...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants