MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_package

Method is_package

Lib/importlib/_bootstrap_external.py:742–748  ·  view source on GitHub ↗

Concrete implementation of InspectLoader.is_package by checking if the path returned by get_filename has a filename of '__init__.py'.

(self, fullname)

Source from the content-addressed store, hash-verified

740 SourcelessFileLoader."""
741
742 def is_package(self, fullname):
743 """Concrete implementation of InspectLoader.is_package by checking if
744 the path returned by get_filename has a filename of '__init__.py'."""
745 filename = _path_split(self.get_filename(fullname))[1]
746 filename_base = filename.rsplit('.', 1)[0]
747 tail_name = fullname.rpartition('.')[2]
748 return filename_base == '__init__' and tail_name != '__init__'
749
750 def create_module(self, spec):
751 """Use default semantics for module creation."""

Callers 1

spec_from_file_locationFunction · 0.45

Calls 4

_path_splitFunction · 0.70
get_filenameMethod · 0.45
rsplitMethod · 0.45
rpartitionMethod · 0.45

Tested by

no test coverage detected