On this page
pkgutil.ModuleInfo
Prev: pkgutil.iter_modules | Up: pkgutil | Next: pkgutil.read_code
Rel: pkgutil.extend_path, pkgutil.get_data, pkgutil.get_importer, pkgutil.iter_importers
Ref: docs.python.org โ pkgutil.ModuleInfo
Tags: #public #python3 #stdlib #pkgutil
Import
import pkgutil
from pkgutil import ModuleInfo
Signature & Overview
pkgutil.ModuleInfo(module_finder, name, ispkg)
A namedtuple with minimal info about a module.
Methods & Attributes
ModuleInfo.count(self, value, /)โ Return number of occurrences of value.ModuleInfo.index(self, value, start=0, stop=9223372036854775807, /)โ Return first index of value.
Usage
import json
import pkgutil
mods = list(pkgutil.iter_modules(json.__path__))
assert len(mods) >= 1 and isinstance(mods[0], pkgutil.ModuleInfo)
Gotchas
- Named tuple
(module_finder, name, ispkg): Yielded byiter_modules()andwalk_packages().
REPL Inspect
from pkgutil import ModuleInfo
help(ModuleInfo)
Linked from
Related notes
- tuts/python3/stdlib_module/pkgutil/iter_modules Linked here; links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/read_code Linked here; links to this page; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/pkgutil/extend_path Linked here; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/get_data Linked here; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/get_importer Linked here; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/iter_importers Linked here; shared tags: #pkgutil, #stdlib
- tuts/python3/stdlib_module/pkgutil/walk_packages shared tags: #pkgutil, #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib