You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Null dereference with multiple assignments in single statement #7937
it's a change in type inference exposing an existing bug
Right, the return type of the .get() method was declared in that commit, which changes the set of assigned types for line_number and subsequently part.
line_number gets correctly inferred as Python int due to the assignment from mapping.get(). This lets part and offset correctly get inferred as Python int, but the value on the right hand side of the cascaded assignment doesn't get adapted because we end up with two target types, object and int. Obviously not contradicting and simple to resolve, but we don't resolve it, currently. I'll see what I can come up with.
Activity
da-woods commentedon Aug 26, 2026
This bisects to f73bb64. My suspicion is that it's a change in type inference exposing an existing bug but could be wrong there.
scoder commentedon Aug 27, 2026
Right, the return type of the
.get()method was declared in that commit, which changes the set of assigned types forline_numberand subsequentlypart.line_numbergets correctly inferred as Pythonintdue to the assignment frommapping.get(). This letspartandoffsetcorrectly get inferred as Pythonint, but the value on the right hand side of the cascaded assignment doesn't get adapted because we end up with two target types,objectandint. Obviously not contradicting and simple to resolve, but we don't resolve it, currently. I'll see what I can come up with.scoder commentedon Aug 27, 2026
Turns out, the code was accidentally overwriting a variable in a loop. Simple bug. PR is #7940
scoder commentedon Aug 27, 2026
The bug equally applies to 3.2.x and just didn't show there yet.
Fix accidental variable overwriting in loop. (GH-7940)
Fix accidental variable overwriting in loop. (GH-7940)
scoder commentedon Aug 28, 2026
3.2.x commit is fc3dfb1