当前位置: 首页>>代码示例>>Python>>正文


Python b.keys方法代码示例

本文整理汇总了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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:26,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:30,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:12,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:10,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:5,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py

示例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) 
开发者ID:remg427,项目名称:misp42splunk,代码行数:6,代码来源:test_fixers.py


注:本文中的x.a.b.keys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。