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

🐛 Fix parameterless Depends() with generics #9479

Merged
merged 5 commits into from Apr 2, 2024

Conversation

nzig
Copy link
Contributor

@nzig nzig commented May 2, 2023

Previously, using parameterless Depends() in a generic context would bind the dependency to the first encountered concrete type.

Fixes #9450.

Previously, using parameterless `Depends()` in a generic context
would bind the dependency to the first encountered concrete type.

Fixes tiangolo#9450.
@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2023

📝 Docs preview for commit a8cb514 at: https://64515f2306603a0078b9209c--fastapi.netlify.app

Copy link

@odiseo0 odiseo0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done, very clean

Copy link

@Ryandaydev Ryandaydev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass.

Copy link

@Jaza Jaza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thorough tests, well done

@PinkOatmeal
Copy link

Looking forward to this fix. I want to use code from #9450 as example to implement injection of contollers in my project

@9en9i
Copy link

9en9i commented May 31, 2023

Hi @nzig, I've been watching this pr all month. And I'm already beginning to think that if it will be put in, it will not happen very soon. But it's a very cool fix, which will allow to write less monotonous code for your classes. Maybe it's possible to do something to get this pr accepted faster?

@nzig
Copy link
Contributor Author

nzig commented Jun 10, 2023

@9en9i That's up to @tiangolo. He's the only one that can merge PRs.

@tiangolo tiangolo added the feature New feature or request label Oct 2, 2023
@9en9i
Copy link

9en9i commented Nov 15, 2023

@tiangolo hi, is it possible that this bug fix request will ever be accepted?

@9en9i
Copy link

9en9i commented Nov 15, 2023

@Kludex @JarroVGIT @jgould22 @ycd Perhaps one of you can somehow contribute to the promotion of this pull request? This request fixes a feature that was added a little less than a year ago, and it would be nice to get full functionality.

@FieryDruid
Copy link

@tiangolo hi! This is a very cool feature that makes the code more readable and clean. Should we hope for its will be accepted?

@tiangolo tiangolo added bug Something isn't working and removed feature New feature or request labels Apr 2, 2024
@tiangolo tiangolo merged commit eec612c into tiangolo:master Apr 2, 2024
22 checks passed
@tiangolo
Copy link
Owner

tiangolo commented Apr 2, 2024

Thanks @nzig! 🚀

And thanks everyone for the discussion. ☕

This will be available in the next hours in FastAPI 0.110.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants