tiangolo / fastapi

FastAPI framework, high performance, easy to learn, fast to code, ready for production
https://fastapi.tiangolo.com/
MIT License
73.78k stars 6.22k forks source link

♻️ Refactor getting first item from list in `fastapi/utils.py` #11436

Open jd-solanki opened 3 months ago

jd-solanki commented 3 months ago

Changes according to ruff linting rule

Jaza commented 2 months ago

Looks good to me. Per the ruff rule description, doing it this way is less expensive, and basically has the same behaviour. Tests / docs shouldn't need updating.