/Python

CLI Tools Hidden In The Python Standard Library

- Simon Willison tl;dr: “This is a neat Python feature: modules with a if \_\_name\_\_ == "\_\_main\_\_": block that are available on Python's standard import path can be executed from the terminal using python -m name\_of\_module.” This made Simon: what other little tools are lurking in the Python standard library, available on any computer with a working Python installation? 

featured in #427


Making Python 100x Faster With Less Than 100 Lines Of Rust

- Ohad Ravid tl;dr: “Our system also has to work on-prem with limited CPU resources, and while at first it performed well, as the number of concurrent physical users grew we started running into problems and our system struggled to keep up with the load. We came to the conclusion that we had to make our system at least 50 times faster to handle the increased workload, and we figured that Rust could help us achieve that.”

featured in #426


The Best Tools For Python SDK Creation

tl;dr: Some of the most popular OSS options available for creating Python SDKs go head to head with Speakeasy's managed pipeline. Find out what the pros and cons of each approach are.

featured in #420


Writing Python Like It's Rust

- Jakub Beránek tl;dr: “Eventually, I started adopting some concepts from Rust in my Python programs. It basically boils down to two things - using type hints as much as possible, and upholding the good ol’ making illegal states unrepresentable principle. I try to do this both for programs that will be maintained for a while, but also for oneshot utility scripts.”

featured in #416


ugit: DIY Git In Python

tl;dr: ugit is a small implementation of a Git-like version control system. “It's top goal is simplicity and educational value. ugit is implemented in small incremental steps, with each step explained in detail. Hopefully you will be able to read the small steps and slowly build a complete picture of the internals.”

featured in #414


ChatGPT Plugins: Build Your Own In Python!

- James Briggs tl;dr: OpenAI's ChatGPT launched plugins, which can be built by anyone. James demonstrates how to build a plugin using the chatgpt-retrieval-plugin template.

featured in #402


Keeping The Cloudflare API 'All Green' Using Python-Based Testing

- Elie Mitrani tl;dr: This article discusses Scout, an automated system running Python tests verifying the end to end behavior of Cloudflare’s APIs. Scout evaluates APIs in production-like environments, green lights a production deployment and monitors the behavior of APIs in production. This article dives deep into how it operates.

featured in #399


How Virtual Environments Work

- Brett Cannon tl;dr: “There are two parts to virtual environments: their directories and their configuration file. As a running example, I'm going to assume you ran the command py -m venv --without-pip .venv in some directory on a Unix-based OS.”

featured in #398


GPT In 60 Lines Of NumPy

- Jay Mody tl;dr: "In this post, we'll implement a GPT from scratch in just 60 lines of numpy. We'll then load the trained GPT-2 model weights released by OpenAI into our implementation and generate some text.”

featured in #389


Magical Fibonacci Formulae

- Orson Peters tl;dr: "Wow. Somehow the simple expression x/(1−x−x2) contains’ the entire Fibonacci sequence..." Orson explains how.

featured in #388