sitecustomize._vendor.importlib_metadata._meta

Module Contents

Classes

PackageMetadata

Base class for protocol classes.

SimplePath

A minimal subset of pathlib.Path required by PathDistribution.

Attributes

_T

sitecustomize._vendor.importlib_metadata._meta._T
class sitecustomize._vendor.importlib_metadata._meta.PackageMetadata

Bases: sitecustomize._vendor.importlib_metadata._compat.Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto(Protocol[T]):
    def meth(self) -> T:
        ...
property json: Dict[str, str | List[str]]

A JSON-compatible form of the metadata.

Return type:

Dict[str, Union[str, List[str]]]

__len__()
Return type:

int

__contains__(item)
Parameters:

item (str) –

Return type:

bool

__getitem__(key)
Parameters:

key (str) –

Return type:

str

__iter__()
Return type:

Iterator[str]

get_all(name, failobj=...)

Return all values associated with a possibly multi-valued key.

Parameters:
  • name (str) –

  • failobj (_T) –

Return type:

Union[List[Any], _T]

class sitecustomize._vendor.importlib_metadata._meta.SimplePath

Bases: sitecustomize._vendor.importlib_metadata._compat.Protocol

A minimal subset of pathlib.Path required by PathDistribution.

joinpath()
Return type:

SimplePath

__truediv__()
Return type:

SimplePath

parent()
Return type:

SimplePath

read_text()
Return type:

str