Python bar.foo() Examples
The following are 30
code examples of bar.foo().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
bar
, or try the search function
.
Example #1
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 7 votes |
def test_method_4(self): b = """ class A: def __init__(self, foo): self.foo = foo def next(self): pass def __iter__(self): return self """ a = """ class A: def __init__(self, foo): self.foo = foo def __next__(self): pass def __iter__(self): return self """ self.check(b, a)
Example #2
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 6 votes |
def test_prefix_preservation_4(self): b = """ next = 5 for a in b: foo(a) # abc # def a.next() """ a = """ next = 5 for a in b: foo(a) # abc # def a.__next__() """ self.check(b, a, ignore_warnings=True)
Example #3
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 6 votes |
def test_shadowing_funcdef_2(self): b = """ def next(a): pass class A: def next(self): pass it.next() """ a = """ def next(a): pass class A: def __next__(self): pass it.__next__() """ self.warns(b, a, "Calls to builtin next() possibly shadowed")
Example #4
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 6 votes |
def test_shadowing_funcdef_2(self): b = """ def next(a): pass class A: def next(self): pass it.next() """ a = """ def next(a): pass class A: def __next__(self): pass it.__next__() """ self.warns(b, a, "Calls to builtin next() possibly shadowed")
Example #5
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_funcdef_1(self): s = """ def next(a): pass class A: def next(self, a, b): pass """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #6
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_assign_tuple_1(self): s = """ (next, a) = foo class A: def next(self, a, b): pass """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #7
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_assign_tuple_2(self): s = """ (a, (b, (next, c)), a) = foo class A: def next(self, a, b): pass """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #8
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_assign_list_1(self): s = """ [next, a] = foo class A: def next(self, a, b): pass """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #9
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_for_tuple_2(self): s = """ for a, (next, c), b in it(): pass b = 5 c = 6 """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #10
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_method_3(self): b = """ class A: def next(x): pass """ a = """ class A: def __next__(x): pass """ self.check(b, a)
Example #11
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_global_1(self): s = """ def f(): global next next = 5 """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #12
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_global_2(self): s = """ def f(): global a, next, b next = 5 """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #13
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_for_simple(self): s = """ for next in it(): pass b = 5 c = 6 """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #14
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_noncall_access_2(self): b = """f(g.next + 5)""" a = """f(g.__next__ + 5)""" self.check(b, a)
Example #15
Source File: test_fixers.py From ironpython2 with Apache License 2.0 | 5 votes |
def test_21(self): b = "print h.iterkeys().next()" a = "print iter(h.keys()).next()" self.check(b, a)
Example #16
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_noncall_access_3(self): b = """f(g().next + 5)""" a = """f(g().__next__ + 5)""" self.check(b, a)
Example #17
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_import_from_3(self): s = """ from x import a, next, b class A: def next(self, a, b): pass """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #18
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_shadowing_assign_simple(self): s = """ next = foo class A: def next(self, a, b): pass """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #19
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_builtin_assign_in_tuple(self): s = """ def foo(): (a, __builtin__.next) = foo class A: def next(self, a, b): pass """ self.warns_unchanged(s, "Calls to builtin next() possibly shadowed")
Example #20
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_method_2(self): b = """ class A(object): def next(self): pass """ a = """ class A(object): def __next__(self): pass """ self.check(b, a)
Example #21
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_method_1(self): b = """ class A: def next(self): pass """ a = """ class A: def __next__(self): pass """ self.check(b, a)
Example #22
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_prefix_preservation_6(self): b = """ for a in b: foo(foo(a), # abc a.next()) """ a = """ for a in b: foo(foo(a), # abc next(a)) """ self.check(b, a)
Example #23
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_prefix_preservation_3(self): b = """ next = 5 for a in b: foo(a) a.next() """ a = """ next = 5 for a in b: foo(a) a.__next__() """ self.check(b, a, ignore_warnings=True)
Example #24
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_prefix_preservation_2(self): b = """ for a in b: foo(a) # abc # def a.next() """ a = """ for a in b: foo(a) # abc # def next(a) """ self.check(b, a)
Example #25
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_prefix_preservation_1(self): b = """ for a in b: foo(a) a.next() """ a = """ for a in b: foo(a) next(a) """ self.check(b, a)
Example #26
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_6(self): b = """c( a().next() + b)""" a = """c( next(a()) + b)""" self.check(b, a)
Example #27
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_4(self): b = """a().next()""" a = """next(a())""" self.check(b, a)
Example #28
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_3(self): b = """(a + b).next()""" a = """next((a + b))""" self.check(b, a)
Example #29
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_2(self): b = """a.b.c.d.next()""" a = """next(a.b.c.d)""" self.check(b, a)
Example #30
Source File: test_fixers.py From misp42splunk with GNU Lesser General Public License v3.0 | 5 votes |
def test_1(self): b = """it.next()""" a = """next(it)""" self.check(b, a)