ignore modules

This commit is contained in:
2021-10-24 13:01:36 +02:00
parent 2c8bae6fe1
commit 85262398e7

View File

@ -1,5 +1,6 @@
import inspect
import re
import types
import weakref
import ipywidgets
@ -11,7 +12,7 @@ FOOTER = '</td></tr></table></div>'
SEP = '</td></tr><tr><td>'
LINE = '{0}</td><td>{1}</td><td>{2}</td><td>{3}'
IGNORE = ("In", "Out", "exit", "quit", "get_ipython")
IGNORE_NAMES = ("In", "Out", "exit", "quit", "get_ipython")
SNIP = " ...✀... "
@ -88,7 +89,8 @@ def sorted_naturally(iterable, reverse=False):
return sorted(iterable, key=natural, reverse=reverse)
def is_good_entry(k, v):
return not k.startswith("_") and k not in IGNORE and not isinstance(v, VariableInspector)
ignore_types = (VariableInspector, types.ModuleType)
return not k.startswith("_") and k not in IGNORE_NAMES and not isinstance(v, ignore_types)
def typename(obj):
return type(obj).__name__