Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/yarl/_helpers.py: 69%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import os
2import sys
3from typing import TYPE_CHECKING
5__all__ = ("cached_property",)
8NO_EXTENSIONS = bool(os.environ.get("YARL_NO_EXTENSIONS")) # type: bool
9if sys.implementation.name != "cpython":
10 NO_EXTENSIONS = True
13# isort: off
14if TYPE_CHECKING:
15 from ._helpers_py import cached_property as cached_property_py
17 cached_property = cached_property_py
18elif not NO_EXTENSIONS: # pragma: no branch
19 try:
20 from ._helpers_c import cached_property as cached_property_c # type: ignore[attr-defined, unused-ignore] # noqa: E501
22 cached_property = cached_property_c
23 except ImportError: # pragma: no cover
24 from ._helpers_py import cached_property as cached_property_py
26 cached_property = cached_property_py # type: ignore[assignment, misc]
27else:
28 from ._helpers_py import cached_property as cached_property_py
30 cached_property = cached_property_py # type: ignore[assignment, misc]
31# isort: on