diff options
author | Ionel Cristian Maries <contact@ionelmc.ro> | 2015-02-14 18:13:20 +0200 |
---|---|---|
committer | Ionel Cristian Maries <contact@ionelmc.ro> | 2015-02-14 18:13:20 +0200 |
commit | 6d8412476a296b3a3691af1ffabcb672d9a4920f (patch) | |
tree | e358c7e886ff4d67d0efc6263f0472655efddfff /pylint/test/input/func_typecheck_callfunc_assigment.py | |
parent | 0369bd6a914af3ad92ce53eac3786bf8de785f7f (diff) | |
download | pylint-6d8412476a296b3a3691af1ffabcb672d9a4920f.tar.gz |
Move all package files to a pylint package.
Diffstat (limited to 'pylint/test/input/func_typecheck_callfunc_assigment.py')
-rw-r--r-- | pylint/test/input/func_typecheck_callfunc_assigment.py | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/pylint/test/input/func_typecheck_callfunc_assigment.py b/pylint/test/input/func_typecheck_callfunc_assigment.py new file mode 100644 index 0000000..3a668ab --- /dev/null +++ b/pylint/test/input/func_typecheck_callfunc_assigment.py @@ -0,0 +1,63 @@ +# pylint: disable=R0921, print-statement +"""check assignment to function call where the function doesn't return + + 'E1111': ('Assigning to function call which doesn\'t return', + 'Used when an assignment is done on a function call but the \ + infered function doesn\'t return anything.'), + 'W1111': ('Assigning to function call which only returns None', + 'Used when an assignment is done on a function call but the \ + infered function returns nothing but None.'), + +""" +from __future__ import generators +__revision__ = None + + +def func_no_return(): + """function without return""" + print 'dougloup' + +A = func_no_return() + + +def func_return_none(): + """function returning none""" + print 'dougloup' + return None + +A = func_return_none() + + +def func_implicit_return_none(): + """Function returning None from bare return statement.""" + return + +A = func_implicit_return_none() + + +def func_return_none_and_smth(): + """function returning none and something else""" + print 'dougloup' + if __revision__: + return None + return 3 + +A = func_return_none_and_smth() + +def generator(): + """no problemo""" + yield __revision__ + +A = generator() + +class Abstract(object): + """bla bla""" + + def abstract_method(self): + """use to return something in concrete implementation""" + raise NotImplementedError + + def use_abstract(self): + """should not issue E1111""" + var = self.abstract_method() + print var |