This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
multipub/.pyenv/lib/python3.7/site-packages/pylint/test/functional/function_redefined.py

110 lines
2.3 KiB
Python
Raw Normal View History

2019-02-09 02:45:25 -06:00
# pylint: disable=R0201,missing-docstring,using-constant-test,unused-import,wrong-import-position,reimported, useless-object-inheritance, unnecessary-pass
from __future__ import division
__revision__ = ''
class AAAA(object):
"""docstring"""
def __init__(self):
pass
def method1(self):
"""docstring"""
def method2(self):
"""docstring"""
def method2(self): # [function-redefined]
"""docstring"""
class AAAA(object): # [function-redefined]
"""docstring"""
def __init__(self):
pass
def yeah(self):
"""hehehe"""
def yoo(self):
"""yoo"""
def func1():
"""docstring"""
def func2():
"""docstring"""
def func2(): # [function-redefined]
"""docstring"""
__revision__ = 1 # [redefined-outer-name]
return __revision__
if __revision__:
def exclusive_func():
"docstring"
else:
def exclusive_func():
"docstring"
try:
def exclusive_func2():
"docstring"
except TypeError:
def exclusive_func2():
"docstring"
else:
def exclusive_func2(): # [function-redefined]
"this one redefine the one defined line 42"
def with_inner_function_1():
"""docstring"""
def callback():
"""callback docstring"""
pass
return callback
def with_inner_function_2():
"""docstring"""
def callback():
"""does not redefine callback returned by with_inner_function_1"""
pass
return callback
def some_func():
"""Don't emit if we defined a variable with the same name as a
__future__ directive.
"""
division = 2
return division
def dummy_func():
"""First dummy function"""
pass
def dummy_func():
"""Second dummy function, don't emit function-redefined message
because of the dummy name"""
pass
from math import ceil
def ceil(): # [function-redefined]
pass
import math
def math(): # [function-redefined]
pass
import math as _
def _():
pass
# pylint: disable=too-few-public-methods
class ObjectProxy:
"""ABC"""
# We actually *redefine* these attributes, but these shouldn't
# be considered actual redefinitions. Issue #2451
@property
def __module__(self):
return "actual.module"
@property
def __doc__(self):
return "Docstring"