當前位置: 首頁>>代碼示例>>Python>>正文


Python UserList.__init__方法代碼示例

本文整理匯總了Python中collections.UserList.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python UserList.__init__方法的具體用法?Python UserList.__init__怎麽用?Python UserList.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在collections.UserList的用法示例。


在下文中一共展示了UserList.__init__方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from collections import UserList [as 別名]
# 或者: from collections.UserList import __init__ [as 別名]
def __init__(self, type, fetch=False, check=False,
                 parent=None, recursive=1, session=None, **kwargs):
        assert('fq_name' in kwargs or 'uuid' in kwargs or 'to' in kwargs)
        super(Resource, self).__init__(session=session)
        self.type = type

        UserDict.__init__(self, kwargs)
        self.from_dict(self.data)

        if parent:
            self.parent = parent

        if check:
            self.check()

        if fetch:
            self.fetch(recursive=recursive)

        self.properties = {prop.key: prop for prop in self.schema.properties}
        self.emit('created', self) 
開發者ID:eonpatapon,項目名稱:contrail-api-cli,代碼行數:22,代碼來源:resource.py

示例2: context_stacker

# 需要導入模塊: from collections import UserList [as 別名]
# 或者: from collections.UserList import __init__ [as 別名]
def context_stacker(
    inherit: Type, context_managers: Dict[str, AsyncContextManager]
) -> Type:
    """
    Using :func:`aenter_stack`
    """

    class ContextStacker(inherit):
        def __init__(self, *args, **kwargs) -> None:
            super().__init__(*args, **kwargs)
            self._stack = None

        async def __aenter__(self):
            await super().__aenter__()
            self._stack = await aenter_stack(self, context_managers)
            return self

        async def __aexit__(self, exc_type, exc_value, traceback):
            await super().__aexit__(exc_type, exc_value, traceback)
            await self._stack.aclose()

    return ContextStacker 
開發者ID:intel,項目名稱:dffml,代碼行數:24,代碼來源:asynchelper.py

示例3: __init__

# 需要導入模塊: from collections import UserList [as 別名]
# 或者: from collections.UserList import __init__ [as 別名]
def __init__(self, subject):
        """Wrap an object as a Proxy object"""
        self._subject = subject 
開發者ID:Autodesk,項目名稱:arnold-usd,代碼行數:5,代碼來源:Util.py

示例4: __init__

# 需要導入模塊: from collections import UserList [as 別名]
# 或者: from collections.UserList import __init__ [as 別名]
def __init__(self, kind, kids=[]):
        self.kind = intern(kind)
        UserList.__init__(self, kids) 
開發者ID:rocky,項目名稱:python-spark,代碼行數:5,代碼來源:ast.py

示例5: __init__

# 需要導入模塊: from collections import UserList [as 別名]
# 或者: from collections.UserList import __init__ [as 別名]
def __init__(self):
        UserList.__init__(self)
        self.current_deck = None
        self.reload() 
開發者ID:pajbot,項目名稱:pajbot,代碼行數:6,代碼來源:deck.py

示例6: __init__

# 需要導入模塊: from collections import UserList [as 別名]
# 或者: from collections.UserList import __init__ [as 別名]
def __init__(self, items=None, eol=None, path=None, encoding='utf-8'):
        UserList.__init__(self, items or [])
        self._eol = eol
        self.path = path
        self.encoding = encoding 
開發者ID:caronc,項目名稱:nzb-subliminal,代碼行數:7,代碼來源:srtfile.py

示例7: __init__

# 需要導入模塊: from collections import UserList [as 別名]
# 或者: from collections.UserList import __init__ [as 別名]
def __init__(self, parent: "AsyncContextManagerList"):
        UserList.__init__(self)
        self.parent = parent
        self.__stack = None
        self.logger = LOGGER.getChild(
            "AsyncContextManagerListContext.%s"
            % (self.__class__.__qualname__,)
        ) 
開發者ID:intel,項目名稱:dffml,代碼行數:10,代碼來源:asynchelper.py


注:本文中的collections.UserList.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。