Closed danielballan closed 5 years ago
LGTM. 👍 on using those two functions.
I think this is a good idea, to avoid having to copy/paste can we just add these to the suitcase-cookiecutter so they are automatically included?
can we just add these to the suitcase-cookiecutter so they are automatically included?
Yep:
If merged I will open similar PRs into the other suitcases, the documented example in suitcase-core's docs, and the cookiecutter.
Of course that won't affect the existing suitcases, so we'll still need to do PRs into those.
Thanks!
Is there a good reason not to do this? It introduces one more programming concept that a Serializer author would need to use, but all they have to do is copy/paste the
__enter__
and__exit__
blocks as is, which doesn't seem too bad.On the plus side, it makes it easy to clean up correctly, and it matches the semantics of
open
and*Manager.open
, which can be used as contexts.If merged I will open similar PRs into the other suitcases, the documented example in suitcase-core's docs, and the cookiecutter.