Running Python 3.7.3 on Ubuntu 18.04 x64
For some reason, when using this decorator outside of the module it is declared in, it causes doctests to disappear at runtime.
For some reason, modifying the cached_property class to inherit from property fixes this. I got this idea from werkzeug.
I'm not going to pretend to understand why either is happening (your class preserves __doc__ like it should, but some magic in property makes it accessible where it isn't otherwise).
Running Python 3.7.3 on Ubuntu 18.04 x64
For some reason, when using this decorator outside of the module it is declared in, it causes doctests to disappear at runtime.
For some reason, modifying the
cached_propertyclass to inherit frompropertyfixes this. I got this idea from werkzeug.I'm not going to pretend to understand why either is happening (your class preserves
__doc__like it should, but some magic inpropertymakes it accessible where it isn't otherwise).