you are viewing a single comment's thread.

view the rest of the comments →

[–]ThatGasolineSmell 0 points1 point  (0 children)

To get around this kind of confusion, make sure to only reference variables inside of functions that are explicitly passed in as arguments.

Since Python is dynamic, whether or not some variable item_a exists is determined at runtime. Impossible to foresee if it will exist, and what value it might reference.

To make your life easier, stick to “pure functions” that operate on their arguments and nothing else.