[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN]otate
- From: Geoff Leyland <geoff_leyland@...>
- Date: Sat, 27 Apr 2013 19:34:36 +1200
On 26/04/2013, at 12:43 AM, Philipp Janda <email@example.com> wrote:
> return values are not that easy either
Handling return values at all seems pretty hard with a hook (anyone got any bright ideas?), so it's either a decorator as you use, or writing a tricky loader that parses doc comments and adds code, as Steve suggested at one stage.
> [*]: Ahh, new idea: Unit testing using examples in the docstring ...
It's an idea I really like.  does something similar: it looks for <pre> blocks in markdown files (i.e. lines with four spaces in front of them) and tries to execute them, checking that the results are the same as indicated by comments in the same style as in PiL. It means that examples in the documentation are always correct. At one stage I thought about doing the same thing for TeX (but then I didn't).