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 / input / func_noerror_classes_meth_could_be_a_function.py @ 745

History | View | Annotate | Download (664 Bytes)

1
# pylint: disable=C0111,R0903,W0232
2
"""
3
#2479
4

5
R0201 (formely W0212), Method could be a function shouldn't be emitted in case
6
like factory method pattern
7
"""
8
__revision__ = 1
9

    
10
class XAsub(object):
11
    pass
12
class XBsub(XAsub):
13
    pass
14
class XCsub(XAsub):
15
    pass
16

    
17
class Aimpl(object):
18
    # disable "method could be a function" on classes which are not overriding
19
    # the factory method because in that case the usage of polymorphism is not
20
    # detected
21
    # pylint: disable=R0201
22
    def makex(self):
23
        return XAsub()
24

    
25
class Bimpl(Aimpl):
26

    
27
    def makex(self):
28
        return XBsub()
29

    
30
class Cimpl(Aimpl):
31

    
32
    def makex(self):
33
        return XCsub()
34