Tag

global

0 views collected around this technical thread.

Code Mala Tang
Code Mala Tang
Jan 19, 2025 · Fundamentals

Master the 6 Most Common Python Pitfalls and How to Avoid Them

This article explores six frequently misunderstood Python features—mutable default arguments, the difference between is and ==, *args/**kwargs, iterator exhaustion, complex list comprehensions, and the global keyword—explaining why they trip developers up and offering clear, practical solutions to master each one.

IteratorsPitfallsPython
0 likes · 8 min read
Master the 6 Most Common Python Pitfalls and How to Avoid Them
Python Programming Learning Circle
Python Programming Learning Circle
Mar 15, 2021 · Fundamentals

Understanding the global Statement in Python

The article explains how Python's global statement declares variables as global within a function, allowing modification of module‑level variables and preventing UnboundLocalError, with examples of incorrect usage, correct usage, multiple globals, and class‑based alternatives.

fundamentalsglobalprogramming
0 likes · 4 min read
Understanding the global Statement in Python
Python Programming Learning Circle
Python Programming Learning Circle
Jan 17, 2020 · Fundamentals

Master Python Variable Scope: The LENGB Guide Explained

This article explains Python’s static variable scope, introducing the LENGB model (Local, Enclosing, nonlocal, Global, Built‑in) and demonstrates how Python resolves names through examples that illustrate common pitfalls such as NameError and the correct use of global and nonlocal keywords.

LENGBPythonglobal
0 likes · 4 min read
Master Python Variable Scope: The LENGB Guide Explained