Taken from Gentoo, which adapted https://github.com/agronholm/typeguard/commit/e0db07a777d5a481eaba6162354adf32286ce21b diff --git a/src/typeguard/__init__.py b/src/typeguard/__init__.py index 5684d63..27fa30b 100644 --- a/src/typeguard/__init__.py +++ b/src/typeguard/__init__.py @@ -61,22 +61,25 @@ except ImportError: from typing import _ForwardRef as ForwardRef evaluate_forwardref = ForwardRef._eval_type -if sys.version_info >= (3, 10): - from typing import is_typeddict -else: - _typed_dict_meta_types = () - if sys.version_info >= (3, 8): - from typing import _TypedDictMeta - _typed_dict_meta_types += (_TypedDictMeta,) +try: + from typing_extensions import is_typeddict +except ImportError: + if sys.version_info >= (3, 10): + from typing import is_typeddict + else: + _typed_dict_meta_types = () + if sys.version_info >= (3, 8): + from typing import _TypedDictMeta + _typed_dict_meta_types += (_TypedDictMeta,) - try: - from typing_extensions import _TypedDictMeta - _typed_dict_meta_types += (_TypedDictMeta,) - except ImportError: - pass + try: + from typing_extensions import _TypedDictMeta + _typed_dict_meta_types += (_TypedDictMeta,) + except ImportError: + pass - def is_typeddict(tp) -> bool: - return isinstance(tp, _typed_dict_meta_types) + def is_typeddict(tp) -> bool: + return isinstance(tp, _typed_dict_meta_types) if TYPE_CHECKING: ='right' method='get' action='/guix/log/build-aux/update-NEWS.scm'>
path: root/build-aux/update-NEWS.scm
AgeCommit message (Expand)Author
2021-05-10maint: update-NEWS: Sort packages prior writing to the data file....* build-aux/update-NEWS.scm (main): Sort packages. Maxim Cournoyer
2021-04-23build-aux: Relax the regexp used to match NEWS sections....A number of packages doesn't really make sense in the name of the section to be substituted. This change allows using simply '*** new packages' instead of '*** 1999 new packages', for example, and have the update-NEWS.scm script update it. * build-aux/update-NEWS.scm (write-packages-added) <regexp>: Do not care about leading white space in the name of the section. Maxim Cournoyer