New submission from Antoine Pitrou: doctest uses inspect.isfunction() to detect callable objects on which to detect docstrings. Unfortunately, this prevents running doctests on functions which have been decorated to return other types of callables (for example numba's @jit decorator). In the attached example file, the wrapped "bar" function does not have its doctest executed.
It would be useful for doctest to be more flexible here, although I'm not sure what the exact criterion should be. ---------- components: Library (Lib) files: ducktest.py messages: 220384 nosy: ezio.melotti, gvanrossum, michael.foord, pitrou, r.david.murray, rhettinger, tim.peters priority: normal severity: normal stage: needs patch status: open title: doctest doesn't allow duck-typing callables type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file35601/ducktest.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21740> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com