Skip to content

Commit f1cf9c3

Browse files
committed
BUG: numpydoc: check that it works with sub-classes
1 parent 1d23f66 commit f1cf9c3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

numpydoc/docscrape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ def methods(self):
511511
return [name for name,func in inspect.getmembers(self._cls)
512512
if ((not name.startswith('_')
513513
or name in self.extra_public_methods)
514-
and callable(func))]
514+
and callable(func) and not isinstance(func, type))]
515515

516516
@property
517517
def properties(self):

numpydoc/tests/test_docscrape.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,10 @@ def spammity(self):
603603
"""Spammity index"""
604604
return 0.95
605605

606+
class Ignorable(object):
607+
"""local class, to be ignored"""
608+
pass
609+
606610
for cls in (ClassDoc, SphinxClassDoc):
607611
doc = cls(Dummy, config=dict(show_class_members=False))
608612
assert 'Methods' not in str(doc), (cls, str(doc))

0 commit comments

Comments
 (0)