evhub / coconut

Simple, elegant, Pythonic functional programming.
http://coconut-lang.org
Apache License 2.0
4.07k stars 121 forks source link

Coconut doesn't convert doctest docstrings #321

Open ArneBachmann opened 7 years ago

ArneBachmann commented 7 years ago

This broke my tests, when I attempted to use the print <| round(...) syntax into the docstrings.

Or, as an alternative solution, run doctest's docstrings somehow through the coconut interpreter instead of the Python interpreter (monkey-patch the doctest internals somehow or replace it by _coconut_doctest?)

evhub commented 7 years ago

@ArneBachmann That's a good point! Putting this on the v1.3.1 milestone.

ArneBachmann commented 5 years ago

Any progress? Would need to somehow AST the docstrings and transpile them as well. It's definitely a minor feature, as doctest is only used by 5% of all people vs. pytest, unitest etc. I, however, do use it, because it doesn't require external libraries and can be tested on every import of a file.