Issues with E1102: "not callable"

Hi I'm fairly new to pylint and I've followed all the suggestions to clean up my code and make it more readable. But there's one error I can't get rid of in this piece of code:
def api_put(api_path, payload): """This function makes PUT requests to the api""" if api_path.startswith("http"): url = api_path else: url = SERVICE_URL + api_path
The error I'm getting is:
[pylint] E1102:api_path.startswith is not callable
I checked but there's not much info about it:
http://pylint-messages.wikidot.com/messages:e1102
The code works because the argument api_path is a string, so it indeed is callable. Of course if I change it to:
if str(api_path).startswith("http"):
Then the error disappear. But I already know it is a string, and I've always read you shouldn't type-check in Python.
Can anyone shed some light? Thanks!

Hey,
On Tue, Aug 01, 2017 at 01:06:48PM +0100, Tomàs Núñez wrote:
The error I'm getting is:
[pylint] E1102:api_path.startswith is not callable
That output seems like a very old pylint version to me. Can you make sure you have pylint 1.7.2 and astroid 1.5.3?
Florian

Oh, I'm really sorry, you're right.
Someone left in our repository a zip with the master git branch from may 2016, and pip thought it was v2.0.0, and was installing it over 1.7.2. I forced v1.7.2 and that message disappeared.
Thanks a lot!
El dia 1 ag. 2017 15:08, "Florian Bruhin" me@the-compiler.org va escriure:
Hey,
On Tue, Aug 01, 2017 at 01:06:48PM +0100, Tomàs Núñez wrote:
The error I'm getting is:
[pylint] E1102:api_path.startswith is not callable
That output seems like a very old pylint version to me. Can you make sure you have pylint 1.7.2 and astroid 1.5.3?
Florian
-- https://www.qutebrowser.org | me@the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc I love long mails! | https://email.is-not-s.ms/
participants (2)
-
Florian Bruhin
-
Tomàs Núñez