Tagged articles
5 articles
Page 1 of 1
Python Programming Learning Circle
Python Programming Learning Circle
Jun 3, 2021 · Fundamentals

How to Write Good Python Functions: Six Guidelines for Idiomatic Code

This article outlines six practical guidelines for writing clean, maintainable Python functions—including meaningful naming, single responsibility, comprehensive docstrings, returning useful values, limiting length, and ensuring idempotence or purity—illustrated with code examples and explanations to help developers improve function quality.

PythonSoftware Engineeringcoding
0 likes · 13 min read
How to Write Good Python Functions: Six Guidelines for Idiomatic Code
MaGe Linux Operations
MaGe Linux Operations
Jan 8, 2019 · Fundamentals

Turn Your Code Into Clean, Pythonic Idioms: A Practical Guide

This article walks through what makes code Pythonic, offering clear examples and better alternatives for loops, collections, dictionaries, unpacking, context managers, decorators, and other common patterns to help developers write more readable, efficient, and idiomatic Python.

Code Optimizationbest practicescontext managers
0 likes · 16 min read
Turn Your Code Into Clean, Pythonic Idioms: A Practical Guide
MaGe Linux Operations
MaGe Linux Operations
Feb 2, 2018 · Fundamentals

Master Pythonic Loops: Elegant Techniques for Cleaner Code

The article presents Raymond Hettinger's PyCon 2013 notes on writing Pythonic code, covering loops, collections, dictionary handling, performance tips, context managers, and best practices, with examples and improved alternatives to help developers write clear, efficient, and idiomatic Python.

CollectionsLoopsPython
0 likes · 15 min read
Master Pythonic Loops: Elegant Techniques for Cleaner Code
MaGe Linux Operations
MaGe Linux Operations
Nov 6, 2017 · Fundamentals

Unlock Pythonic Iteration: Clean, Efficient Ways to Loop Over Collections

This guide reveals Pythonic techniques for iterating over ranges, lists, dictionaries, and multiple collections, showing how to write concise, readable loops, use built‑in functions like zip and enumerate, and apply advanced tools such as defaultdict, ChainMap, and context managers for cleaner and faster code.

LoopsPythonbest practices
0 likes · 16 min read
Unlock Pythonic Iteration: Clean, Efficient Ways to Loop Over Collections
MaGe Linux Operations
MaGe Linux Operations
Oct 26, 2015 · Fundamentals

What Makes Code Truly Pythonic? 20 Idiomatic Examples Explained

This article explains the concept of "pythonic" code in Python, comparing concise, readable idioms with longer non‑pythonic alternatives across common tasks such as swapping variables, truth testing, string manipulation, list operations, comprehensions, dictionary handling, loop control, ternary expressions, enumerate, and zip.

code styleexamplesidiomatic
0 likes · 10 min read
What Makes Code Truly Pythonic? 20 Idiomatic Examples Explained