santhosh <[email protected]> added the comment:
def split_module_names(module):
unnamed, named = set(), set()
for name in dir(module):
if not name.startswith('_'):
attr = getattr(module, name)
try:
if hasattr(attr, '__name__'):
named.add(name)
else:
unnamed.add(name)
except TypeError:
pass
return named, unnamed
----------
nosy: +santhu_reddy12 -andrei.avk, defreng, ezio.melotti, lukasz.langa,
michael.foord, rbcollins, serhiy.storchaka, terry.reedy, xtreak, zach.ware
versions: +Python 3.8 -Python 3.11
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41322>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com