Message242673
| Author |
magnusc |
| Recipients |
ezio.melotti, magnusc, michael.foord, r.david.murray, rbcollins, rhettinger, serhiy.storchaka, steven.daprano |
| Date |
2015年05月06日.13:54:58 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1430920498.84.0.578943655812.issue24134@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
"The solution to that is to always have a test that your decorator actually returns a function. That's what I do."
Yes, I agree that with more tests I would have found the problem, but sometimes you forget things. And to me I want the tests to fail by default or for cases that are unspecified.
I think the sentinel solution would come a long way of solving both the issue that I reported but still keep the context solution intact.
Out of curiosity, would it be a solution to have the sentinel be a real function?
def _sentinel():
pass |
|