-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infer fails on deterministic functions #852
Comments
Hi, thanks for the report. astroid currently cannot follow argument values passed from call sites down to the inference site. In the second case, we are able to infer the value because we know for sure it's an integer as it is passed in the attribute initialisation. That's not the case for the first case though, as the value is passed from the initialisation of the class down to the attributes. This is a long standing "bug" (or feature request) #142 which is non-trivial to solve. |
When the inferred name is derived from a deterministic function or deterministic class method the
infer()
function fails.Could anyone explain or fix this behavior?
Steps to reproduce
For example where the value is supposed to be inferred from class method:
while this case is inferable:
Current behavior
returns Uninferable
Expected behavior
instead of <Const.int l.4 at 0x235fa76ab88>
python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"
outputPython 3.7.7
astroid 2.5.0
The text was updated successfully, but these errors were encountered: