本文整理汇总了Python中typing.MutableSet方法的典型用法代码示例。如果您正苦于以下问题:Python typing.MutableSet方法的具体用法?Python typing.MutableSet怎么用?Python typing.MutableSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类typing
的用法示例。
在下文中一共展示了typing.MutableSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __get_deps
# 需要导入模块: import typing [as 别名]
# 或者: from typing import MutableSet [as 别名]
def __get_deps(
self,
attr: str,
feedables: MutableSet[Feedable],
parameterizeds: MutableSet[Parameterized]) -> None:
attr_val = getattr(self, attr, None)
if attr_val is None:
return
deps = [] # type: List[GenericModelPart]
if isinstance(attr_val, GenericModelPart):
deps = [attr_val]
elif isinstance(attr_val, Iterable):
deps = [a for a in attr_val if isinstance(a, GenericModelPart)]
for dep in deps:
feeds, params = dep.get_dependencies()
feedables |= feeds
parameterizeds |= params
示例2: test_mutableset
# 需要导入模块: import typing [as 别名]
# 或者: from typing import MutableSet [as 别名]
def test_mutableset(self):
assert isinstance(set(), typing.MutableSet)
assert not isinstance(frozenset(), typing.MutableSet)
示例3: __init__
# 需要导入模块: import typing [as 别名]
# 或者: from typing import MutableSet [as 别名]
def __init__(self, *args, **kwargs):
super(TransactionSet, self).__init__(*args, **kwargs)
self._inner_set: MutableSet[VT] = set()
示例4: test_mutableset
# 需要导入模块: import typing [as 别名]
# 或者: from typing import MutableSet [as 别名]
def test_mutableset(self):
self.assertIsInstance(set(), typing.MutableSet)
self.assertNotIsInstance(frozenset(), typing.MutableSet)