Blog

Python tutorials and tips on the Academify blog. Learn programming with examples, exercises, and projects from basic to advanced

A laptop screen showing a code editor with visible programming code in a dimly lit environment.
Advanced Python
Foto de perfil de Leandro Hirt da Academify

Python UserDict: Custom Mappings

Learn Python UserDict for custom mappings with validation, normalization, composition, copying, and predictable mutation behavior.

Read more

Reading time: 2 minutes
August 30, 2026
Detailed close-up of yellow and white albino python scales, capturing texture and pattern.
Advanced Python
Foto de perfil de Leandro Hirt da Academify

itertools.accumulate: Running Sums and State

Learn Python itertools.accumulate for running sums, balances, records, custom state transitions, and lazy data pipelines.

Read more

Reading time: 2 minutes
August 30, 2026
A developer typing code on a laptop with a Python book beside in an office.
Advanced Python
Foto de perfil de Leandro Hirt da Academify

itertools.groupby: Group Sorted Data Correctly

Learn Python itertools.groupby for ordered data, streaming aggregation, shared iterators, object keys, and correct grouping behavior.

Read more

Reading time: 2 minutes
August 30, 2026
Close-up of hands typing on a laptop keyboard, Python book in sight, coding in progress.
Advanced Python
Foto de perfil de Leandro Hirt da Academify

contextlib.chdir: Risks of Changing Directories

Learn Python contextlib.chdir, its global-state and concurrency risks, and when pathlib or subprocess cwd is the safer design.

Read more

Reading time: 3 minutes
August 30, 2026
A person typing on a laptop with a Python programming book visible, capturing technology and learning.
Advanced Python
Foto de perfil de Leandro Hirt da Academify

Python nullcontext: Optional Contexts

Use Python nullcontext to unify optional files, locks, transactions, sessions, and borrowed resources without duplicate branches.

Read more

Reading time: 4 minutes
August 30, 2026
Detailed shot of a Jungle Carpet Python (Morelia spilota cheynei) in its natural habitat.
Advanced Python
Foto de perfil de Leandro Hirt da Academify

contextlib.aclosing: Close Async Generators Safely

Learn Python contextlib.aclosing to close async generators safely after break, return, exceptions, cancellation, and partial consumption.

Read more

Reading time: 5 minutes
August 30, 2026
Detailed close-up texture of a snake's patterned skin showcasing natural patterns and scales.
Advanced Python
Foto de perfil de Leandro Hirt da Academify

weakref.finalize: Cleanup Without Retaining Objects

Learn Python weakref.finalize for safe fallback cleanup without retaining objects, including alive, detach, shutdown, and explicit close.

Read more

Reading time: 5 minutes
August 30, 2026
Close-up view of a computer screen displaying code in a software development environment.
Advanced Python
Foto de perfil de Leandro Hirt da Academify

SimpleNamespace: Lightweight Attribute Objects

Learn Python SimpleNamespace for lightweight attribute objects, dictionary conversion, copying, JSON, and choosing better typed models.

Read more

Reading time: 5 minutes
August 29, 2026