Yields ------ :class:`types.Module` Python modules.
()
| 102 | |
| 103 | |
| 104 | def iter_modules() -> "Iterable[types.ModuleType]": |
| 105 | """ |
| 106 | Yields |
| 107 | ------ |
| 108 | :class:`types.Module` |
| 109 | Python modules. |
| 110 | """ |
| 111 | for module_name in sys.stdlib_module_names - IGNORED_MODULES: |
| 112 | try: |
| 113 | with warnings.catch_warnings(): |
| 114 | warnings.filterwarnings("ignore", category=DeprecationWarning) |
| 115 | module = __import__(module_name) |
| 116 | except ImportError: |
| 117 | warnings.warn(f"Could not import {module_name}", category=ImportWarning) |
| 118 | continue |
| 119 | |
| 120 | yield module |
| 121 | |
| 122 | |
| 123 | def iter_c_modules() -> "Iterable[types.ModuleType]": |
no test coverage detected