[Python-Dev] Proposed changes to PEP 343

Fredrik Lundh fredrik at pythonware.com
Fri Oct 7 12:26:34 CEST 2005

Nick Coghlan wrote:

>     9. Here's a proposed native context manager for decimal.Context:
>         # This would be a new decimal.Context method
>         @contextmanager
>         def __with__(self):

wouldn't it be better if the ContextWrapper class (or some variation thereof) could
be used as a base class for the decimal.Context class?  using decorators on methods
to provide "is a" behaviour for the class doesn't really feel pythonic...


More information about the Python-Dev mailing list