The implementation of the Mapping protocol for ESLEvent may seem like a sugar code, but it can make it easier to handle events when working with a handler.
The implemented methods serve only as interface for accessing self.headers, so this change does not imply any backward compatibility.
I believe that this adaptation makes the code more pytonic, because if the object behaves like a mapping and is used as a mapping, then it must be a mapping.
The implementation of the Mapping protocol for ESLEvent may seem like a sugar code, but it can make it easier to handle events when working with a handler.
The implemented methods serve only as interface for accessing self.headers, so this change does not imply any backward compatibility.
Example of use:
I believe that this adaptation makes the code more pytonic, because if the object behaves like a mapping and is used as a mapping, then it must be a mapping.