Fix callable class generator dependencies#1365
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1365 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 226 226
Lines 6785 6822 +37
=========================================
+ Hits 6785 6822 +37
Continue to review full report at Codecov.
|
|
Looks like using the |
|
@tiangolo this is ready to review if you'd like to take a look |
|
Excellent job @mrosales ! 🙇 🚀 🤓 Including all the investigation with the backport, very clever! Thanks for your contribution! ☕ 🍰 |
|
Hello, may I ask if there are any specific considerations for replacing In Python version 3.9, this change will prevent asynchronous functions compiled with Cython from executing correctly, as Is it possible to revert this method back to asyncio.iscoroutinefunction? If possible, I will submit a pull request. |
Fixes/related to #1204
Resolving dependencies uses
inspect.isgeneratorfunctionandinspect.isasyncgenfunctionwhich match async methods and functions, but not a class (or other callable) that has an async generator__call__method.It also adds 4 new test cases to ensure that dependencies work as expected for class methods that yield instead of return values.