本文整理汇总了Python中twitter.common.collections.OrderedDict.update方法的典型用法代码示例。如果您正苦于以下问题:Python OrderedDict.update方法的具体用法?Python OrderedDict.update怎么用?Python OrderedDict.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter.common.collections.OrderedDict
的用法示例。
在下文中一共展示了OrderedDict.update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: identify_zinc_jars
# 需要导入模块: from twitter.common.collections import OrderedDict [as 别名]
# 或者: from twitter.common.collections.OrderedDict import update [as 别名]
def identify_zinc_jars(zinc_classpath):
"""Find the named jars in the zinc classpath.
TODO: Make these mappings explicit instead of deriving them by jar name heuristics.
"""
ret = OrderedDict()
ret.update(ZincUtils.identify_jars(ZincUtils.ZINC_JAR_NAMES, zinc_classpath))
return ret
示例2: identify_zinc_jars
# 需要导入模块: from twitter.common.collections import OrderedDict [as 别名]
# 或者: from twitter.common.collections.OrderedDict import update [as 别名]
def identify_zinc_jars(zinc_classpath):
"""Find the named jars in the zinc classpath.
TODO: When profiles migrate to regular pants jar() deps instead of ivy.xml files we can
make these mappings explicit instead of deriving them by jar name heuristics.
"""
ret = OrderedDict()
ret.update(ZincUtils.identify_jars(ZincUtils.zinc_jar_names, zinc_classpath))
return ret
示例3: identify_zinc_jars
# 需要导入模块: from twitter.common.collections import OrderedDict [as 别名]
# 或者: from twitter.common.collections.OrderedDict import update [as 别名]
def identify_zinc_jars(compiler_classpath, zinc_classpath):
"""Find the named jars in the compiler and zinc classpaths.
TODO: When profiles migrate to regular pants jar() deps instead of ivy.xml files we can make these
mappings explicit instead of deriving them by jar name heuristics.
"""
ret = OrderedDict()
ret.update(ScalaCompile.identify_jars(ScalaCompile.compiler_jar_names, compiler_classpath))
ret.update(ScalaCompile.identify_jars(ScalaCompile.zinc_jar_names, zinc_classpath))
return ret
示例4: test_default_maybe_list
# 需要导入模块: from twitter.common.collections import OrderedDict [as 别名]
# 或者: from twitter.common.collections.OrderedDict import update [as 别名]
def test_default_maybe_list():
HELLO_WORLD = ['hello', 'world']
assert maybe_list('hello') == ['hello']
assert maybe_list(('hello', 'world')) == HELLO_WORLD
assert maybe_list(['hello', 'world']) == HELLO_WORLD
assert maybe_list(OrderedSet(['hello', 'world', 'hello'])) == HELLO_WORLD
assert maybe_list(s for s in ('hello', 'world')) == HELLO_WORLD
od = OrderedDict(hello=1)
od.update(world=2)
assert maybe_list(od) == HELLO_WORLD
assert maybe_list([]) == []
assert maybe_list(()) == []
assert maybe_list(set()) == []
with pytest.raises(ValueError):
maybe_list(123)
with pytest.raises(ValueError):
maybe_list(['hello', 123])
assert maybe_list(['hello', 123], expected_type=(str, int)) == ['hello', 123]
assert maybe_list(['hello', 123], expected_type=(int, str)) == ['hello', 123]