[Python] What's `_distutils_hack.DistutilsMetaFinder` in `sys.meta_path`?

Discussão em 'Python' iniciado por Stack, Abril 23, 2025.

  1. Stack

    Stack Membro Participativo

    The document of Python's import system tells that there are 3 default finders/importers (built-in, frozen, and the import path one). But when trying to get the repr of sys.meta_path, I got another _distutils_hack.DistutilsMetaFinder. What's this and what's it for?

    I've tried on 3.13 and 3.12, and they give similar results like:

    >>> import sys
    >>> sys.meta_path
    [<_distutils_hack.DistutilsMetaFinder object at 0x7f396eb1ba70>, <class '_frozen_importlib.BuiltinImporter'>, <class '_frozen_importlib.FrozenImporter'>, <class '_frozen_importlib_external.PathFinder'>]

    Continue reading...

Compartilhe esta Página