I ran into an issue wherein I had to jsonify everything that my API was set to return. As I was writing a decorator and applying it to every single method, a thought occurred to me:
"Can't I just overwrite the return keyword so that it performs this operation for me every time?"
I did some searching, but I can't find anything on the topic. However, since "everything is an object", maybe it's possible?
Obviously overwriting return
is a bad idea but in a more general sense, my question is:
Can you alter the behavior of reserved words and keywords in Python?