Changes ternary conditionals to be PEP308 compliant by kentwait · Pull Request #5827 · encode/django-rest-framework (original) (raw)
Description
Updates the tutorial and the codebase to be be PEP308-compliant with regards to conditional ternary operations this if condition else that
.
I came across this from following the tutorial and found that the example was using condition and this or that
-style conditional which seemed not very Pythonic. The codebase only uses this style once and this pull request also changes that instance.