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:
The code works because the argument api_path is a string, so it indeed is callable. Of course if I change it to:
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!