The biggest Python topics of 2023 ›

Python Operator Overloading and Lambda Functions

Python's operator overloading and function handling features are explored in this set of documents, illustrating how operators can be customized using dunder methods and how higher-order functions can enhance code readability and reusability. Examples include using the operator module for functional programming and understanding the key parameter in Python functions.


Higher Order Functions in Python Article

Higher-order functions in Python take functions as arguments, or return them as results, making code more readable and reusable. This brief article shows you the concept and highlights examples in the standard library.

https://www.techbeamers.com/higher-order-functions-in-python/

Real-World match/case Article

The match statement was added in Python 3.10. This article covers a real-world example use case and shows its power.

https://nedbatchelder.com/blog/202312/realworld_matchcase.html

What Are Lambda Expressions? Article

This post teaches you what lambda expressions are and how they get used in Python. It shows several examples and also covers when to avoid them.

https://www.pythonmorsels.com/lambda-expressions/

Working With the Python operator Module Article

In this tutorial, you’ll explore the Python operator module and its role in functional programming. You’ll code several examples of using both operator-equivalent and higher-order functions in programs.

https://realpython.com/python-operator-module/

Recursion in Python Article

A recursive function is one that calls itself. In this video course, you’ll see what recursion is, how it works in Python, and under what circumstances you should use it.

https://realpython.com/courses/python-recursion/

What Is *args and How Do You Use It? Article

This article explains what *args means in Python and how to use it in your own functions.

https://mathspp.com/blog/what-is-args-and-how-do-you-use-it

Say It Again: Values Not Expressions Article

Sometimes you can explain a simple thing for the thousandth time, and come away with a deeper understanding yourself. It happened to Ned the other day with Python mutable argument default values.

https://nedbatchelder.com/blog/202311/say_it_again_values_not_expressions.html

The Fanout Pattern Explained Article

The fanout pattern is one where a single task replaces itself with a variable number of other tasks. This article covers how that happens in Celery and what that entails.

https://www.better-simple.com/django/2023/12/06/fanout-pattern-explained/

The Key to the key Parameter in Python Article

A parameter named key is present in several Python functions, such as sorted(). This article explores what it is and how to use it.

https://www.thepythoncodingstack.com/p/the-key-to-the-key-parameter-in-python

Divmod for Unit Conversions Article

Python’s built-in divmod() provides the quotient and remainder of two numbers. This kind of division occurs frequently when calculating unit conversions. This article shows some examples.

https://mathspp.com/blog/divmod-for-unit-conversions

What Are Python Asterisk and Slash Special Parameters For? Article

In this tutorial, you’ll learn how to use the Python asterisk and slash special parameters in function definitions. With these symbols, you can define whether your functions will accept positional or keyword arguments.

https://realpython.com/python-asterisk-and-slash-special-parameters/

Overloading Arithmetic Operators With Dunder Methods Article

This article shows you how to overload the arithmetic operators in Python with dunder methods. It includes examples for add, radd, and iadd, while also outlining how to deal with error conditions in dunder methods.

https://mathspp.com/blog/pydonts/overloading-arithmetic-operators-with-dunder-methods

Python’s in and not in Operators: Check for Membership Article

In this tutorial, you’ll learn how to check if a given value is present or absent in a collection of values using Python’s in and not in operators, respectively. This type of check is known as membership test in Python.

https://realpython.com/python-in-operator/

Operator Overloading in Python Article

Python is an object-oriented programming language and one of its features is that it supports operator overloading, learn how to overload common operators such as addition, subtraction, comparison, and more.

https://monadical.com/posts/operator-overloading-in-python.html

A Practical Use for &= Article

Can you already picture real use cases for this little Pythonic gem? Learn about the bitwise-and-equal operator and where it can be used.

https://medium.com/@petefison/python-a-practical-use-for-10b2df3aa744

Dictionary Dispatch Pattern in Python Article

The dictionary dispatch pattern uses a dict to store references to functions, allowing you to replace long if/else statements or as an alternative to the match statement. Read on for how and where to use it.

https://martinheinz.dev/blog/90