Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / pylint / test / functional / function_redefined.py @ 745

History | View | Annotate | Download (1.51 KB)

1
# pylint: disable=R0201,missing-docstring,using-constant-test
2
from __future__ import division
3
__revision__ = ''
4

    
5
class AAAA(object):
6
    """docstring"""
7
    def __init__(self):
8
        pass
9
    def method1(self):
10
        """docstring"""
11

    
12
    def method2(self):
13
        """docstring"""
14

    
15
    def method2(self): # [function-redefined]
16
        """docstring"""
17

    
18
class AAAA(object): # [function-redefined]
19
    """docstring"""
20
    def __init__(self):
21
        pass
22
    def yeah(self):
23
        """hehehe"""
24
    def yoo(self):
25
        """yoo"""
26
def func1():
27
    """docstring"""
28

    
29
def func2():
30
    """docstring"""
31

    
32
def func2(): # [function-redefined]
33
    """docstring"""
34
    __revision__ = 1 # [redefined-outer-name]
35
    return __revision__
36

    
37
if __revision__:
38
    def exclusive_func():
39
        "docstring"
40
else:
41
    def exclusive_func():
42
        "docstring"
43

    
44
try:
45
    def exclusive_func2():
46
        "docstring"
47
except TypeError:
48
    def exclusive_func2():
49
        "docstring"
50
else:
51
    def exclusive_func2(): # [function-redefined]
52
        "this one redefine the one defined line 42"
53

    
54

    
55
def with_inner_function_1():
56
    """docstring"""
57
    def callback():
58
        """callback docstring"""
59
        pass
60
    return callback
61

    
62
def with_inner_function_2():
63
    """docstring"""
64
    def callback():
65
        """does not redefine callback returned by with_inner_function_1"""
66
        pass
67
    return callback
68

    
69
def some_func():
70
    """Don't emit if we defined a variable with the same name as a
71
    __future__ directive.
72
    """
73
    division = 2
74
    return division