pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/importlib_metadata/commit/5c844d960296a9e5f24e3ef1389e59ec21e94b7f

Add tests asserting that protocols match stdlib also. · python/importlib_metadata@5c844d9 · GitHub
Skip to content

Commit 5c844d9

Browse files
committed
Add tests asserting that protocols match stdlib also.
1 parent 95967ae commit 5c844d9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

importlib_metadata/_meta.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
Protocol,
88
TypeVar,
99
overload,
10+
runtime_checkable,
1011
)
1112

1213
_T = TypeVar("_T")
1314

1415

16+
@runtime_checkable
1517
class PackageMetadata(Protocol):
1618
def __len__(self) -> int: ... # pragma: no cover
1719

@@ -71,6 +73,7 @@ def read_bytes(self) -> bytes: ... # pragma: no cover
7173
def exists(self) -> bool: ... # pragma: no cover
7274

7375

76+
@runtime_checkable
7477
class IPackagePath(Protocol):
7578
hash: Any | None
7679
size: int | None
@@ -88,6 +91,7 @@ def parts(self) -> tuple[str, ...]: ... # pragma: no cover
8891
def __fspath__(self) -> str: ... # pragma: no cover
8992

9093

94+
@runtime_checkable
9195
class IDistribution(Protocol):
9296
def read_text(
9397
self, filename: str | os.PathLike[str]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy