From 16919e21936179e53df2f376c8b59b5fc44bd2dd Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 15 Jan 2021 09:22:52 -0500 Subject: [PATCH] Fix for Python 3.9+. Fixes . Based on an idea in https://github.com/ilevkivskyi/typing_inspect/issues/60#issuecomment-683187584. --- typing_inspect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typing_inspect.py b/typing_inspect.py index 1ca68ed..31d05ee 100644 --- a/typing_inspect.py +++ b/typing_inspect.py @@ -21,7 +21,7 @@ LEGACY_TYPING = False if NEW_TYPING: from typing import ( - Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, ForwardRef + Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, _SpecialGenericAlias, ForwardRef ) from typing_extensions import Literal else: @@ -75,7 +75,7 @@ def is_generic_type(tp): """ if NEW_TYPING: return (isinstance(tp, type) and issubclass(tp, Generic) or - isinstance(tp, _GenericAlias) and + (isinstance(tp, _GenericAlias) or isinstance(tp, _SpecialGenericAlias)) and tp.__origin__ not in (Union, tuple, ClassVar, collections.abc.Callable)) return (isinstance(tp, GenericMeta) and not isinstance(tp, (CallableMeta, TupleMeta))) -- 2.29.2 tdiff
AgeCommit message (Expand)Author
2016-07-21services: Export *-service-type and *-configuration....This allows users to use 'modify-services' and similar constructs for all these service types. * gnu/services/avahi.scm: export avahi-configuration. * gnu/services/base.scm: export gpm-configuration and rngd-configuration. * gnu/services/databases.scm: export *-service-type and *-configuration. * gnu/services/dbus.scm: export dbus-configuration. * gnu/services/dict.scm: export dicod-service-type. * gnu/services/lirc.scm: export lirc-configuration and lirc-service-type. * gnu/services/mail.scm: export dovecot-service-type. * gnu/services/web.scm: export nginx-configuration and nginx-service-type. * gnu/services/xorg.scm: export screen-locker and screen-locker?. * gnu/services/ssh.scm: export lsh-configuration and lsh-service-type. * gnu/services/desktop.scm: export *-service, *-service-type and *-configuration. * gnu/services/networking.scm: export *-configuration and *-service-type. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Tomáš Čech