|
21 | 21 | from . import requirements, specifiers, utils, version as version_module |
22 | 22 |
|
23 | 23 | T = typing.TypeVar("T") |
24 | | -if sys.version_info[:2] >= (3, 8): # pragma: no cover |
25 | | - from typing import Literal, TypedDict |
26 | | -else: # pragma: no cover |
27 | | - if typing.TYPE_CHECKING: |
28 | | - from typing_extensions import Literal, TypedDict |
29 | | - else: |
30 | | - try: |
31 | | - from typing_extensions import Literal, TypedDict |
32 | | - except ImportError: |
33 | | - |
34 | | - class Literal: |
35 | | - def __init_subclass__(*_args, **_kwargs): |
36 | | - pass |
37 | | - |
38 | | - class TypedDict: |
39 | | - def __init_subclass__(*_args, **_kwargs): |
40 | | - pass |
41 | | - |
| 24 | +from typing import Literal, TypedDict |
42 | 25 |
|
43 | 26 | try: |
44 | | - ExceptionGroup |
| 27 | + ExceptionGroup # Added in Python 3.11+ |
45 | 28 | except NameError: # pragma: no cover |
46 | 29 |
|
47 | 30 | class ExceptionGroup(Exception): # noqa: N818 |
@@ -504,7 +487,7 @@ def __set_name__(self, _owner: "Metadata", name: str) -> None: |
504 | 487 | self.raw_name = _RAW_TO_EMAIL_MAPPING[name] |
505 | 488 |
|
506 | 489 | def __get__(self, instance: "Metadata", _owner: Type["Metadata"]) -> T: |
507 | | - # With Python 3.8, the caching can be replaced with functools.cached_property(). |
| 490 | + # With Python 3.8+, the caching can be replaced with functools.cached_property(). |
508 | 491 | # No need to check the cache as attribute lookup will resolve into the |
509 | 492 | # instance's __dict__ before __get__ is called. |
510 | 493 | cache = instance.__dict__ |
|
0 commit comments