Did I find the right examples for you? yes no

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)
Return a memoizing metaclass with the given name and key function.
And yes that makes this a parametrized meta-metaclass, which is probably
the most meta thing you've ever seen. If it isn't, both congratulations
and sympathies are in order!

        def memento_factory(name, func):
    """
    Return a memoizing metaclass with the given name and key function.
    And yes that makes this a parametrized meta-metaclass, which is probably
    the most meta thing you've ever seen. If it isn't, both congratulations
    and sympathies are in order!
    """

    def call(cls, *args, **kwargs):
        key = func(cls, args, kwargs)
        try:
            return _memento_cache[key]
        except KeyError:
            instance = type.__call__(cls, *args, **kwargs)
            _memento_cache[key] = instance
            return instance

    mc = type(name, (type,), {'__call__': call})
    return mc