Composite.context can be implemented slimmer/simpler using contextlib.contextmanager.
Furthermore, instead of calling Composite.context, the same functionality could be implemented as Composite.__call__, as the context is the main functionality, and this would remove a little bit of overhead, although .context may be more descriptive.
Composite.context
can be implemented slimmer/simpler usingcontextlib.contextmanager
. Furthermore, instead of callingComposite.context
, the same functionality could be implemented asComposite.__call__
, as the context is the main functionality, and this would remove a little bit of overhead, although.context
may be more descriptive.