Closed spumer closed 4 years ago
Think we should be able to do this seamlessly ?
Something like:
try:
from contextdecorator import ContextDecorator as BaseObject
except ImportError:
BaseObject = object
class PidFile(BaseObject):
...
If so seems like a good addition to me :-)
Yea, i think yes. I will make a PR :)
See https://github.com/trbs/pid/commit/afff6e9d3b052f22fd25546db9bd99b55daedb9c and https://pypi.org/project/pid/3.0.2/
Thanks for the suggestion !
ContextDecorator allow use the same object as decorator and context manager.
It's very simple and more pythonic than additional decorator. But
ContextDecorator
added only in 3.2 in standart library.What do you think about that?