I have following code:
#!/usr/bin/env python
"""pylint behavior test"""
def autodetect_method(method, data):
"""autodetect method"""
if not method:
method = 'POST' if data else 'GET'
else:
method = method.upper()
return method
pylint produces the following error:
tt.py:10:17: E1101: Class 'method' has no 'upper' member (no-member)
Error is not reported if I rename method variable to something else, f.e. to method_name!
So, I know several ways to get rid of this error message. But I am very curious what is so special with variable name method and why the error is generated?
Just in case this problem is version-specific, my versions are:
$ pylint --version
pylint 2.4.4
astroid 2.3.3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0]