metautils.py 文件源码

python
阅读 48 收藏 0 点赞 0 评论 0

项目:catalyst 作者: enigmampc 项目源码 文件源码
def with_metaclasses(metaclasses, *bases):
    """Make a class inheriting from ``bases`` whose metaclass inherits from
    all of ``metaclasses``.

    Like :func:`six.with_metaclass`, but allows multiple metaclasses.

    Parameters
    ----------
    metaclasses : iterable[type]
        A tuple of types to use as metaclasses.
    *bases : tuple[type]
        A tuple of types to use as bases.

    Returns
    -------
    base : type
        A subtype of ``bases`` whose metaclass is a subtype of ``metaclasses``.

    Notes
    -----
    The metaclasses must be written to support cooperative multiple
    inheritance. This means that they must delegate all calls to ``super()``
    instead of inlining their super class by name.
    """
    return six.with_metaclass(compose_types(*metaclasses), *bases)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号