github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.69k stars 1.54k forks source link

LGTM.com - false positive: unable to infer presence of `__call__` overload #3741

Open eric-wieser opened 4 years ago

eric-wieser commented 4 years ago

Description of the false positive The lines in question are:

L21 = layout.MultiVector(...)
L12 = layout.MultiVector(...)
K = L21 + L12 + 2.0
beta = K(4)  # Call to a non-callable of builtin-class float.

Where:

URL to the alert on the project page on LGTM.com

https://lgtm.com/projects/g/pygae/clifford/snapshot/23c8649145cc81a9a44e7b0e445d7e000639101e/files/clifford/tools/g3c/__init__.py#x3c80edcfa911a30d:1

RasmusWL commented 4 years ago

Hi @eric-wieser , thanks for reporting this and making it very easy to understand the problem :+1:

Can't make any promises on when we'll be able to look into solving this one, but we'll keep it in our backlog :blush:

pguyot commented 4 years ago

I believe the same issue can be observed here: https://lgtm.com/projects/g/nabaztag2018/pynab/snapshot/68130b0d49b0700d2075bdd4d2814457a338e00c/files/nabclockd/nabclockd.py?sort=name&dir=ASC&mode=heatmap#x67ebc4b61c617ff0:1

With GettzFunc from dateutil which also defines __call__. https://github.com/dateutil/dateutil/blob/2.8.1/dateutil/tz/tz.py#L1552