[issue21740] doctest doesn't allow duck-typing callables

2021-10-23 Thread Yoann Aubineau
Change by Yoann Aubineau : -- nosy: -yaubi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21740] doctest doesn't allow duck-typing callables

2014-12-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 12ef799a9a51 by Zachary Ware in branch 'default': Issue #21740: Fix module name in NEWS entry. https://hg.python.org/cpython/rev/12ef799a9a51 -- ___ Python tracker rep...@bugs.python.org

[issue21740] doctest doesn't allow duck-typing callables

2014-12-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset d22ca7496c54 by Yury Selivanov in branch 'default': Issue #21740: Support wrapped callables in pydoc. Patch by Claudiu Popa. https://hg.python.org/cpython/rev/d22ca7496c54 -- nosy: +python-dev ___ Python

[issue21740] doctest doesn't allow duck-typing callables

2014-12-08 Thread Yury Selivanov
Yury Selivanov added the comment: Thank you for the patch, Claudiu! -- nosy: +yselivanov resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21740

[issue21740] doctest doesn't allow duck-typing callables

2014-08-25 Thread Claudiu Popa
Changes by Claudiu Popa pcmantic...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21740 ___ ___

[issue21740] doctest doesn't allow duck-typing callables

2014-07-28 Thread Yoann Aubineau
Changes by Yoann Aubineau yoann.aubin...@gmail.com: -- nosy: +yaubi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21740 ___ ___ Python-bugs-list

[issue21740] doctest doesn't allow duck-typing callables

2014-07-03 Thread Claudiu Popa
Claudiu Popa added the comment: Here's a test patch which uses inspect.unwrap. Unfortunately, I can't test with numba, so I don't know if it works for that, but any decorated function which uses `functools.update_wrapper` or `wraps` should be detected by doctest. -- keywords: +patch

[issue21740] doctest doesn't allow duck-typing callables

2014-06-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure, because it would also select classes. Is there any reason to preclude classes? They could reasonably have docstrings that contain doctests. I don't know. I just didn't want to change doctest behaviour too much, but if people more

[issue21740] doctest doesn't allow duck-typing callables

2014-06-29 Thread Guido van Rossum
Guido van Rossum added the comment: Class doctests are already supported separately, see https://docs.python.org/3/library/doctest.html#which-docstrings-are-examined -- nosy: +Guido.van.Rossum ___ Python tracker rep...@bugs.python.org

[issue21740] doctest doesn't allow duck-typing callables

2014-06-20 Thread Claudiu Popa
Claudiu Popa added the comment: How about using this? diff -r 1e74350dd056 Lib/doctest.py --- a/Lib/doctest.pyTue Jun 17 22:27:46 2014 -0500 +++ b/Lib/doctest.pyFri Jun 20 11:08:00 2014 +0300 @@ -984,7 +984,8 @@ for valname, val in obj.__dict__.items():

[issue21740] doctest doesn't allow duck-typing callables

2014-06-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm not sure, because it would also select classes. Is there any reason to preclude classes? They could reasonably have docstrings that contain doctests. -- ___ Python tracker rep...@bugs.python.org

[issue21740] doctest doesn't allow duck-typing callables

2014-06-19 Thread Ezio Melotti
Ezio Melotti added the comment: Would using callable() instead of inspect.isfunction() be ok? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21740 ___

[issue21740] doctest doesn't allow duck-typing callables

2014-06-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ezio Melotti added the comment: Would using callable() instead of inspect.isfunction() be ok? I'm not sure, because it would also select classes. I guess we need something a bit smarter. -- ___ Python tracker

[issue21740] doctest doesn't allow duck-typing callables

2014-06-12 Thread Antoine Pitrou
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