Homepage
Open in app
Sign inGet started

Python Supply

Examples and tutorials that illustrate concepts in an accessible way using the Python programming language.

Go to the profile of Andrei Lapets
Andrei Lapets
Oct 29, 2020

Guide to Publishing Packages

This article is a step-by-step guide to assembling and publishing a small, open-source Python package. While…

Read more…
Go to the profile of Andrei Lapets
Andrei Lapets
Sep 30, 2020

Applications of Immutability

Suppose you are implementing a service that works with data sets that represent routes on a map (e.g., collections of driving directions or logs of past trips). The road network is represented as a graph with nodes and edges, and each route is conceptually a collection of edges…

Read more…
Go to the profile of Andrei Lapets
Andrei Lapets
Aug 26, 2020

Comprehensions and Combinations

If you are working on a project in which you must enumerate, traverse, and/or test every possible…

Read more…
Go to the profile of Andrei Lapets
Andrei Lapets
Jul 30, 2020

Working with Foreign Functions

Suppose your Python library needs to load some sensitive binary data from a file into a contiguous block…

Read more…
Go to the profile of Andrei Lapets
Andrei Lapets
Jun 14, 2020

Static Checking via Metaclasses

Suppose you are maintaining a domain-specific machine learning library. Users of the library’s API expect that every machine learning algorithm offered by the API will have the same interface (i.e., the same methods with the same signatures) regardless of its underlying…

Read more…
1 response
Go to the profile of Andrei Lapets
Andrei Lapets
May 29, 2020

Advantages of Type Annotations

Suppose you are working on a project in Python that takes advantage of Python’s support for higher-order functions. Perhaps you are allowing users to specify their own hooks or event handlers within a web application framework, or you are creating a unit testing library that…

Read more…
Go to the profile of Andrei Lapets
Andrei Lapets
Apr 25, 2020

Embedded Languages via Overloading

Suppose you are creating a Python library for building logical circuits. You would like programmers…

Read more…
Go to the profile of Andrei Lapets
Andrei Lapets
Mar 26, 2020

Analyzing and Transforming Abstract Syntax

You manage a large Python codebase that interacts with another vendor’s library. A…

Read more…
Go to the profile of Andrei Lapets
Andrei Lapets
Feb 17, 2020

Iterators, Generators, and Uncertainty

Suppose you are working on a Python API that provides access to a real-time data stream (perhaps from an array of sensors or from a web service that handles user requests). You would like to deliver to the consumers of your API a simple but flexible abstraction…

Read more…
Go to the profile of Andrei Lapets
Andrei Lapets
Jan 19, 2020

Map, Reduce, and Multiprocessing

Multiprocessing capabilities can be an effective tool for speeding up a time-consuming workflow by…

Read more…
About Python SupplyLatest StoriesArchiveAbout MediumTermsPrivacy