min()
and max()
Functions
Python's min()
and max()
functions can take an iterable
or multiple positional parameters, and support a key parameter for custom comparisons.
By Christoph Schiessl on Python
Learn how to have your OS randomly select a port number for your web server to get around the issue of hard-coded ports during development.
By Christoph Schiessl on Python, FastAPI, and DevOps
sum()
Function
In this article, we explore Python's built-in sum()
function, its parameters, and some extreme use cases it wasn't even designed for.
By Christoph Schiessl on Python
Last-Modified
and If-Modified-Since
Headers
Learn about timestamp-based caching in HTTP using the Last-Modified
and If-Modified-Since
headers, with Python's FastAPI as an example.
By Christoph Schiessl on Python and FastAPI
Learn about the custom date/time formatting rules defined in legacy standards like RFC 5322 and how to work with them using Python's datetime
module.
By Christoph Schiessl on Python
Do you struggle with inconsistent JSON formatting across your Git repository? Learn how to reformat everything using Python with this step-by-step guide.
By Christoph Schiessl on DevOps, Git, and Python
ETag
and If-None-Match
Headers
Learn how to use ETag
and If-None-Match
headers to limit your web application's resource consumption by preventing data retransfers.
By Christoph Schiessl on Python and FastAPI
This article explains how to use the Levenshtein algorithm to compare sentences by looking for word differences instead of character differences.
By Christoph Schiessl on Python
Learn about encapsulation in Python. This article explains public, protected, and private members and the conventions used to implement them.
By Christoph Schiessl on Python
Learn how to use catch-all parameters in Python functions with this guide. Capture excess positional and keyword arguments to make your functions more flexible.
By Christoph Schiessl on Python
Fully understand Python's boolean operators for negation, conjunction, and disjunction. Master operator precedence and short-circuiting.
By Christoph Schiessl on Python
any()
Function
Learn how to use the built-in any()
function in Python to determine if any element in an iterable
is True
, with implementation and performance insights.
By Christoph Schiessl on Python
id()
Function
Learn about object identities and comparisons in Python. Discover the built-in id()
function, the is
and is not
operators, and more.
By Christoph Schiessl on Python
Learn how to calculate a month's first and last days using Python's built-in datetime
module, with step-by-step explanations and code examples.
By Christoph Schiessl on Python
bool()
Class
Learn about boolean values in Python and the standard truth testing procedure. Understand how objects are converted to True
or False
.
By Christoph Schiessl on Python
Learn how to find the first and last day of a year with Python's datetime
module. This article explains step by step what you need to know.
By Christoph Schiessl on Python
StaticFiles
Learn how to serve a static site using FastAPI. Perfect for locally testing statically generated websites, for instance, with httpie
.
By Christoph Schiessl on Python and FastAPI
Learn about the Levenshtein distance algorithm, a popular and easy-to-implement way to measure the similarity between two strings.
By Christoph Schiessl on Python
Learn about keyword-only parameters in Python, how to define them, and their interplay with position-only parameters.
By Christoph Schiessl on Python
Learn about positional parameters in Python and a special syntax that allows functions to declare certain parameters as position-only.
By Christoph Schiessl on Python
Learn about Python functions with default parameters. Understand how default parameters work and some essential restrictions and evaluation rules.
By Christoph Schiessl on Python
callable()
Function
Learn about the callable()
function in Python. This article explains how everything in Python is potentially callable, including classes and instances.
By Christoph Schiessl on Python
Learn about functions with simple parameters in Python, including how the called can decide to use positional or keyword notation.
By Christoph Schiessl on Python
Explore Python's function definition statement and discover its features with this series of articles. Get started with this simple introduction.
By Christoph Schiessl on Python
all()
Function
Learn how to use the built-in all()
function in Python for boolean logic, with examples and different implementations.
By Christoph Schiessl on Python
I send two weekly emails on building performant and resilient Web Applications with Python, JavaScript and PostgreSQL. No spam. Unscubscribe at any time.