HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/ipapython/install/typing.py
#
# Copyright (C) 2016  FreeIPA Contributors see COPYING for license
#

import weakref


_cache = weakref.WeakValueDictionary()


class ListMeta(type):
    def __getitem__(cls, key):
        if not isinstance(key, type):
            raise TypeError("Parameters to generic types must be types. "
                            "Got {!r}.".format(key))

        t = ListMeta(
            cls.__name__,
            cls.__bases__,
            {
                '__parameters__': (key,),
                '__init__': cls.__init__,
            }
        )

        return _cache.get(key, t)


class List(list, metaclass=ListMeta):
    __parameters__ = ()

    def __init__(self, *_args, **_kwargs):
        raise TypeError("Type List cannot be instantiated; use list() instead")