Tagged articles
30 articles
Page 1 of 1
DeepHub IMBA
DeepHub IMBA
Mar 10, 2026 · Fundamentals

7 Hidden Python Stdlib Tools That Simplify Your Code

The article presents seven powerful Python standard‑library features—generators for lazy evaluation, defaultdict for concise counting, pathlib for robust path handling, functools.partial for quick function specialization, itertools for flattening nested loops, type for dynamic class creation, and decorators for reusable logic—showing how each reduces memory usage, simplifies code, and improves automation.

GeneratorsPythonStandard Library
0 likes · 7 min read
7 Hidden Python Stdlib Tools That Simplify Your Code
Code Mala Tang
Code Mala Tang
Nov 1, 2025 · Fundamentals

How functools.partial Can Simplify Repeated Function Calls in Python

Using Python's functools.partial, you can pre‑fill common arguments to create concise, readable wrappers that eliminate repetitive parameter passing, improve safety, and streamline code in scenarios ranging from email utilities to Flask handlers and machine‑learning pipelines, while avoiding over‑use pitfalls.

Pythonbest practicescode-reuse
0 likes · 6 min read
How functools.partial Can Simplify Repeated Function Calls in Python
Test Development Learning Exchange
Test Development Learning Exchange
May 25, 2025 · Fundamentals

Understanding Python's functools.partial: Syntax, Benefits, and Practical Examples

This article explains what Python's functools.partial is, shows its basic syntax, outlines its advantages such as reducing code duplication and improving readability, and provides multiple practical code examples—including simple addition, keyword arguments, complex use cases, comparisons with lambda, and real‑world applications in GUI and multithreading contexts.

Higher-Order FunctionsPythoncode-reuse
0 likes · 7 min read
Understanding Python's functools.partial: Syntax, Benefits, and Practical Examples
Test Development Learning Exchange
Test Development Learning Exchange
Dec 26, 2024 · Fundamentals

Using functools.partial to Simplify Function Calls in Python

This article introduces Python's functools.partial for creating partial functions, explains how to import it, and provides multiple practical examples—including simplifying parameter passing, sorting, HTTP requests, mathematical calculations, and string formatting—demonstrating how fixing certain arguments can make code more concise and readable.

Code Examplefunctoolspartial-function
0 likes · 5 min read
Using functools.partial to Simplify Function Calls in Python
Python Programming Learning Circle
Python Programming Learning Circle
Nov 23, 2024 · Fundamentals

Useful Python Tricks and Advanced Techniques

This article presents a collection of lesser‑known Python tricks—including string cleaning with translate, iterator slicing via itertools.islice, skipping header lines, keyword‑only functions, custom context managers, memory‑saving __slots__, resource limits, import control, and total_ordering—to help developers write cleaner, more efficient code.

Memory OptimizationPythoncontext manager
0 likes · 10 min read
Useful Python Tricks and Advanced Techniques
Python Programming Learning Circle
Python Programming Learning Circle
Nov 14, 2024 · Fundamentals

Using Python Dictionaries as a Cache Mechanism

This article explains how Python dictionaries can serve as an efficient caching mechanism, covering basic dictionary concepts, common operations, simple cache examples, advanced techniques like LRU cache implementation, and practical use cases such as caching API responses, with complete code snippets.

CacheLRUdictionary
0 likes · 8 min read
Using Python Dictionaries as a Cache Mechanism
Test Development Learning Exchange
Test Development Learning Exchange
Nov 2, 2024 · Fundamentals

Understanding Python Decorators: Concepts, Examples, and Practical Uses

This article explains Python decorators, covering their definition as higher‑order functions, essential concepts like closures, step‑by‑step examples of basic, parameterized, class‑based, and stateful decorators, as well as practical uses such as logging and caching, all illustrated with clear code snippets.

DecoratorHigher-order functioncaching
0 likes · 6 min read
Understanding Python Decorators: Concepts, Examples, and Practical Uses
Test Development Learning Exchange
Test Development Learning Exchange
Aug 27, 2024 · Fundamentals

An Introduction to Python's functools Module and Its Common Utilities

This article introduces Python's functools module, explaining key utilities such as partial functions, lru_cache, update_wrapper, wraps, cmp_to_key, singledispatch, FunctionTool, cache, and partialmethod, and provides practical code examples demonstrating how to create preset request functions, cache results, update signatures, and implement polymorphic behavior.

Code ExamplesPythonfunctools
0 likes · 7 min read
An Introduction to Python's functools Module and Its Common Utilities
Test Development Learning Exchange
Test Development Learning Exchange
Jul 18, 2024 · Fundamentals

Using functools.partial in Python: Ten Practical Examples

This article introduces Python's functools.partial, explaining how fixing certain function arguments creates new callable functions, and demonstrates ten practical examples ranging from mathematical calculations and file handling to HTTP request wrapping, decorator parameterization, multiprocessing, GUI event binding, logging, data validation, and configuration parsing.

Pythoncode-reusefunctools
0 likes · 7 min read
Using functools.partial in Python: Ten Practical Examples
Test Development Learning Exchange
Test Development Learning Exchange
Mar 16, 2024 · Fundamentals

Python Built-in Functions and Utilities

This article introduces 10 essential Python built-in functions and utilities including enumerate(), zip(), filter(), map(), sorted(), functools.partial(), itertools.combinations(), lambda, getattr()/setattr(), and reversed(), with practical code examples for each.

LambdaMAPPython
0 likes · 3 min read
Python Built-in Functions and Utilities
Python Programming Learning Circle
Python Programming Learning Circle
Jan 31, 2024 · Fundamentals

10 Common Ways to Call Functions in Python

This article introduces ten frequently used Python function‑calling techniques—including built‑ins like filter, eval, exec and utilities from functools and operator—explaining their purpose, typical use cases, and providing clear code examples for each method.

OperatorPythonbuiltin
0 likes · 6 min read
10 Common Ways to Call Functions in Python
Python Programming Learning Circle
Python Programming Learning Circle
Apr 8, 2022 · Fundamentals

A Comprehensive Guide to Python Decorators and Aspect-Oriented Programming (AOP)

This article explains the concept of Aspect‑Oriented Programming (AOP) and demonstrates how Python decorators—both function‑based and class‑based—can be used to implement AOP features such as pre‑ and post‑execution logic, handling arguments, preserving metadata with functools.wraps, and stacking multiple decorators.

Aspect Oriented ProgrammingPythonaop
0 likes · 18 min read
A Comprehensive Guide to Python Decorators and Aspect-Oriented Programming (AOP)
MaGe Linux Operations
MaGe Linux Operations
Aug 29, 2021 · Backend Development

How Python’s singledispatch Simplifies Custom JSON Serialization

This article explores Python’s underused singledispatch feature from PEP 443 as a clean, extensible way to serialize arbitrary objects to JSON, comparing it with traditional json module approaches and showing how it avoids cumbersome if‑elif‑else logic while keeping classes untouched.

BackendPythonfunctools
0 likes · 6 min read
How Python’s singledispatch Simplifies Custom JSON Serialization
Python Programming Learning Circle
Python Programming Learning Circle
Jun 9, 2021 · Fundamentals

Python Tips: String Manipulation, Iterator Slicing, Context Managers, Slots, Resource Limits, and More

This article presents a collection of practical Python techniques—including string cleaning with translation tables, iterator slicing with itertools, skipping file headers, keyword‑only arguments, custom context‑manager objects, memory‑saving __slots__, CPU and memory resource limits, export control via __all__, and simplified total ordering—illustrated with concise code examples.

IteratorPythonString Manipulation
0 likes · 9 min read
Python Tips: String Manipulation, Iterator Slicing, Context Managers, Slots, Resource Limits, and More
MaGe Linux Operations
MaGe Linux Operations
Mar 2, 2019 · Fundamentals

Master Python’s functools: Decorators, partial, caching, and more

This article explores Python’s functools module, demonstrating how to create and use decorators, partial functions, update_wrapper, total_ordering, cmp_to_key, lru_cache, reduce, and singledispatch, with clear code examples that illustrate each utility and its practical applications.

Pythoncachingdecorators
0 likes · 19 min read
Master Python’s functools: Decorators, partial, caching, and more
MaGe Linux Operations
MaGe Linux Operations
Dec 29, 2018 · Fundamentals

Master Python Decorators: From Basics to Advanced Techniques

This comprehensive guide explains why Python decorators are essential, walks through simple and advanced examples—including logging, parameterized, and class-based decorators—covers common pitfalls, and shows how to use tools like functools, decorator.py, and wrapt for clean, reusable code.

DecoratorPythonfunctools
0 likes · 17 min read
Master Python Decorators: From Basics to Advanced Techniques
MaGe Linux Operations
MaGe Linux Operations
May 29, 2018 · Fundamentals

Master Python’s functools: Decorators, Partial, Caching, and More

This article introduces Python’s functools module, explaining how decorators, partial objects, update_wrapper, total_ordering, cmp_to_key, lru_cache, reduce, and singledispatch work, and provides clear code examples that demonstrate their practical use in everyday programming.

Higher-Order Functionscachingdecorators
0 likes · 19 min read
Master Python’s functools: Decorators, Partial, Caching, and More
MaGe Linux Operations
MaGe Linux Operations
Oct 5, 2017 · Fundamentals

Master Python Decorators: Concepts, Usage, and Design Patterns

This article explains what Python decorators are, their key characteristics, how to pass arguments, stack multiple decorators, use built‑in decorators from the standard library such as @property and @wraps, and relates decorator functions to the classic decorator design pattern, all illustrated with clear code examples.

Code Exampledesign patternfunctools
0 likes · 7 min read
Master Python Decorators: Concepts, Usage, and Design Patterns