Pydantic has a great support for Python enums, allowing you to only accept specific values in a field (operation in this case) instead of the primitive type, so you don't have to worry about receiving an invalid operation in the calculate() function body

Just in case, sorry for the bad English

elsamueldev changed pull request status to open
adriiita changed pull request status to merged

Sign up or log in to comment