本文整理汇总了Python中x.a.b.keys方法的典型用法代码示例。如果您正苦于以下问题:Python b.keys方法的具体用法?Python b.keys怎么用?Python b.keys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类x.a.b
的用法示例。
在下文中一共展示了b.keys方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_prefix_preservation
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_prefix_preservation(self):
b = "if d. keys ( ) : pass"
a = "if list(d. keys ( )) : pass"
self.check(b, a)
b = "if d. items ( ) : pass"
a = "if list(d. items ( )) : pass"
self.check(b, a)
b = "if d. iterkeys ( ) : pass"
a = "if iter(d. keys ( )) : pass"
self.check(b, a)
b = "[i for i in d. iterkeys( ) ]"
a = "[i for i in d. keys( ) ]"
self.check(b, a)
b = "if d. viewkeys ( ) : pass"
a = "if d. keys ( ) : pass"
self.check(b, a)
b = "[i for i in d. viewkeys( ) ]"
a = "[i for i in d. keys( ) ]"
self.check(b, a)
示例2: test_trailing_comment
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_trailing_comment(self):
b = "d.keys() # foo"
a = "list(d.keys()) # foo"
self.check(b, a)
b = "d.items() # foo"
a = "list(d.items()) # foo"
self.check(b, a)
b = "d.iterkeys() # foo"
a = "iter(d.keys()) # foo"
self.check(b, a)
b = """[i for i in d.iterkeys() # foo
]"""
a = """[i for i in d.keys() # foo
]"""
self.check(b, a)
b = """[i for i in d.iterkeys() # foo
]"""
a = """[i for i in d.keys() # foo
]"""
self.check(b, a)
b = "d.viewitems() # foo"
a = "d.items() # foo"
self.check(b, a)
示例3: test_unchanged
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_unchanged(self):
for wrapper in fixer_util.consuming_calls:
s = "s = %s(d.keys())" % wrapper
self.unchanged(s)
s = "s = %s(d.values())" % wrapper
self.unchanged(s)
s = "s = %s(d.items())" % wrapper
self.unchanged(s)
示例4: test_01
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_01(self):
b = "d.keys()"
a = "list(d.keys())"
self.check(b, a)
b = "a[0].foo().keys()"
a = "list(a[0].foo().keys())"
self.check(b, a)
示例5: test_04
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_04(self):
b = "d.iterkeys()"
a = "iter(d.keys())"
self.check(b, a)
示例6: test_08
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_08(self):
s = "sorted(d.keys())"
self.unchanged(s)
示例7: test_09
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_09(self):
b = "iter(d.keys())"
a = "iter(list(d.keys()))"
self.check(b, a)
示例8: test_10
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_10(self):
b = "foo(d.keys())"
a = "foo(list(d.keys()))"
self.check(b, a)
示例9: test_11
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_11(self):
b = "for i in d.keys(): print i"
a = "for i in list(d.keys()): print i"
self.check(b, a)
示例10: test_12
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_12(self):
b = "for i in d.iterkeys(): print i"
a = "for i in d.keys(): print i"
self.check(b, a)
示例11: test_14
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_14(self):
b = "[i for i in d.iterkeys()]"
a = "[i for i in d.keys()]"
self.check(b, a)
示例12: test_15
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_15(self):
b = "(i for i in d.keys())"
a = "(i for i in list(d.keys()))"
self.check(b, a)
示例13: test_16
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_16(self):
b = "(i for i in d.iterkeys())"
a = "(i for i in d.keys())"
self.check(b, a)
示例14: test_17
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_17(self):
b = "iter(d.iterkeys())"
a = "iter(d.keys())"
self.check(b, a)
示例15: test_18
# 需要导入模块: from x.a import b [as 别名]
# 或者: from x.a.b import keys [as 别名]
def test_18(self):
b = "list(d.iterkeys())"
a = "list(d.keys())"
self.check(b, a)