PEP 584 dict union operator incompatible with Django REST Framework ReturnDict #8138
Unanswered
zach-waggoner
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Python 3.9 introduced PEP 584, which added the dict union operator (
|
). Unfortunately, this does not appear to work with ReturnDict. For example, this works:But this throws
KeyError: 'serializer'
:If feasible, it would be helpful to support PEP 584, especially because pyupgrade transforms the former into the latter, likely because ReturnDict is a subclass of dict.
Beta Was this translation helpful? Give feedback.
All reactions