Tagged articles
16 articles
Page 1 of 1
Code Mala Tang
Code Mala Tang
Nov 3, 2025 · Fundamentals

When to Use [] vs list() in Python: Performance, Readability, and Pitfalls

This article compares Python's literal [] and the list() constructor, examining their speed differences, readability implications, default‑argument pitfalls, object identity, and appropriate use cases such as creating empty lists, converting iterables, and avoiding mutable default parameters.

ListPythondefault-arguments
0 likes · 8 min read
When to Use [] vs list() in Python: Performance, Readability, and Pitfalls
php Courses
php Courses
Jul 24, 2025 · Fundamentals

Master C++ Default Arguments and Inline Functions: When and How to Use Them

This article explains C++ default arguments and inline functions, covering their definitions, syntax, rules, practical code examples, advantages, appropriate use cases, and key considerations, and compares the two features to help developers write clearer and more efficient code.

Cdefault-argumentsinline functions
0 likes · 5 min read
Master C++ Default Arguments and Inline Functions: When and How to Use Them
Test Development Learning Exchange
Test Development Learning Exchange
Jun 23, 2025 · Fundamentals

Master Python Function Arguments: Positional, Keyword, Default, *args, **kwargs

This guide walks through ten Python function‑argument examples—including positional, keyword, default values, mutable‑default pitfalls, variable‑length *args and **kwargs, argument unpacking, ordering rules, and mutable‑object handling—providing clear code snippets and explanations for each case.

Function ArgumentsPythonargs-kwargs
0 likes · 7 min read
Master Python Function Arguments: Positional, Keyword, Default, *args, **kwargs
Test Development Learning Exchange
Test Development Learning Exchange
May 25, 2025 · Fundamentals

Master Python Functions: Syntax, Parameters, Defaults, and Advanced Tricks

This guide explains how to define Python functions, the role of return statements, differences between positional and keyword arguments, default‑parameter pitfalls, *args/**kwargs usage, argument unpacking, reference passing semantics, positional‑only/keyword‑only parameters, and anonymous lambda functions, all with clear code examples.

LambdaPythonargs-kwargs
0 likes · 6 min read
Master Python Functions: Syntax, Parameters, Defaults, and Advanced Tricks
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.

PitfallsPythonargs-kwargs
0 likes · 8 min read
Master the 6 Most Common Python Pitfalls and How to Avoid Them
php Courses
php Courses
Dec 29, 2023 · Backend Development

Understanding PHP Function Parameter Passing: Pass-by-Value, Pass-by-Reference, Default and Variable‑Length Arguments

This article explains PHP function parameter passing, covering pass‑by‑value versus pass‑by‑reference, how to define functions with multiple, default, and variable‑length arguments, and provides clear code examples illustrating each technique for backend developers.

Function ParametersPHPPass by Reference
0 likes · 4 min read
Understanding PHP Function Parameter Passing: Pass-by-Value, Pass-by-Reference, Default and Variable‑Length Arguments
MaGe Linux Operations
MaGe Linux Operations
Mar 18, 2023 · Backend Development

How a Tiny Python Default Argument Bug Sank Digg v4 and What Developers Can Learn

A detailed post‑mortem of Digg's disastrous v4 launch reveals how a Python function with a mutable default argument caused massive cache overloads, forced emergency fixes, and ultimately contributed to the company's downfall, offering crucial lessons for backend engineers on safe defaults and release planning.

BackendPythonSoftware Engineering
0 likes · 9 min read
How a Tiny Python Default Argument Bug Sank Digg v4 and What Developers Can Learn
MaGe Linux Operations
MaGe Linux Operations
Jun 3, 2019 · Fundamentals

7 Common Python Pitfalls Explained with Code Examples

This article walks through seven tricky Python snippets—default mutable arguments, lambda closures, class variable inheritance, division differences between Python 2 and 3, out‑of‑range slicing, list multiplication side effects, selective list comprehensions, and custom dict subclasses—explaining their outputs and how to fix them.

Class Variablesclosuresdefault-arguments
0 likes · 12 min read
7 Common Python Pitfalls Explained with Code Examples
MaGe Linux Operations
MaGe Linux Operations
Nov 1, 2018 · Fundamentals

Master Python Defaults, Closures, and Class Variables: Common Pitfalls Explained

This article explains why mutable default arguments share state, how Python closures cause late binding issues, the inheritance rules of class variables, differences between division operators in Python 2 and 3, list slicing behavior, list multiplication references, list comprehensions for even-indexed values, and custom dict subclasses with __missing__.

Class VariablesPythonclosures
0 likes · 11 min read
Master Python Defaults, Closures, and Class Variables: Common Pitfalls Explained
MaGe Linux Operations
MaGe Linux Operations
Feb 1, 2018 · Fundamentals

Master Python Functions: From Basics to Advanced Parameter Tricks

This article provides a comprehensive guide to Python functions, covering basic definitions, various parameter types—including default, positional, keyword, variable arguments and keyword‑only parameters—common pitfalls, recursion, lambda expressions, and best practices for clean, reusable code.

LambdaPythonRecursion
0 likes · 14 min read
Master Python Functions: From Basics to Advanced Parameter Tricks
MaGe Linux Operations
MaGe Linux Operations
Dec 26, 2017 · Fundamentals

Common Python Gotchas: Default Arguments, Closures, Class Variables & Division Explained

This article walks through several puzzling Python code snippets, explaining why default mutable arguments share state, how closures suffer from late binding, the inheritance of class variables, differences in division between Python 2 and 3, list slicing quirks, and how list multiplication creates shared references, while also offering corrected implementations.

Class VariablesPythonclosures
0 likes · 12 min read
Common Python Gotchas: Default Arguments, Closures, Class Variables & Division Explained
MaGe Linux Operations
MaGe Linux Operations
Jul 12, 2017 · Fundamentals

10 Common Python Mistakes Every Developer Should Avoid

This article reviews ten frequent Python programming errors—including mutable default arguments, class variable misuse, incorrect exception handling, variable scope pitfalls, list mutation during iteration, closure late binding, circular imports, naming conflicts, Python 2/3 differences, and improper use of del—providing clear explanations and practical solutions to help developers write more reliable code.

ExceptionsPythonVariables
0 likes · 14 min read
10 Common Python Mistakes Every Developer Should Avoid