Python Trending Weekly
ISSUE 5

Python Trending Weekly #5 (2023-06-03)

2023-06-03 Season 1

TL;DR

How much memory does a million concurrent tasks need? Also: PEP 701's plan to formalize f-string syntax and talkGPT4All, a voice chat app running GPT4All locally.

Articles 10 Projects 9 Media 6
🦄

Articles & Tutorials

× 10
01 How Much Memory Does It Take to Run a Million Concurrent Tasks? pkolaczk.github.io

The article tests the memory consumption of popular programming languages (Rust, Go, Java, C#, Python, Node.js, and Elixir) by running 1, 10K, 100K, and 1 million tasks, respectively. The ranking of these languages changes significantly as the number of tasks increases, which surprised me.

Memory usage for 1 million tasks
02 Use These Methods to Make Your Python Concurrent Tasks Perform Better towardsdatascience.com

What are the best practices when using asyncio? This article introduces the asyncio.gather, asyncio.as_completed, and asyncio.wait APIs, as well as the new asyncio.TaskGroup feature introduced in Python 3.11. (Also an incomplete translation.)

  1. The original recommended article was a patchwork and not original, and has been deleted.
04 The Ultimate Guide to Python Multithreading programmingeeksclub.com

This is also a long article that introduces all aspects of Python multithreading. It is really an ultimate guide.

05 How Programming Languages Implement Concurrency: Concurrency Models bmpi.dev

This is another long article that introduces common concurrency models and how different programming languages implement them. Its companion article is "How Programming Languages Implement Concurrency: Operating System Scheduling", both of which are richly illustrated and informative.

Concurrency Models
06 9 Survival Rules for Tencent Programmers segmentfault.com

The author shares his years of experience in code design, architecture design, and work thinking, such as the DRY principle, the SOLID principle, highly available design, how to "be lazy" in every possible way, and so on. (The article mentions the principles of object-oriented programming. Here, I would like to recommend another Tencent programmer's Python Craftsman series, chapters 12-14.)

07 A First Look at Python 3.12! PEP 701 -- Formalizing f-string Syntax juejin.cn

F-strings are one of Python's most useful features, but they also have a number of limitations. The upcoming 3.12 release will formalize the syntax for f-strings, as detailed in PEP-701. This article provides a visual demonstration of how this change will affect the lexical analysis (lexing) of code.

08 Five things to love about the new UI in PyCharm blog.jetbrains.com

Have you tried the new UI in PyCharm yet? This official tutorial introduces how to use the new UI and its highlights.

09 PEP-594 Has Been Implemented: Python 3.13 Removes 20 Stdlib Modules discuss.python.org

Python 3.12's official release is still months away, but 3.13 is already here, eagerly removing 20 standard library modules. Notably, the 2to3 project and the lib2to3 module will also be removed.

10 Grasshopper: An Open-Source Python Library for Load Testing innovation.alteryx.com

Locust is the most popular distributed load testing library for Python, and the article introduces Grasshopper, a new open-source performance testing library based on Locust and Pytest that is more comprehensive.

Image of Grafana dashboard showing Grasshopper and InfluxDB metrics
11 Python Decorators: Enhance Your Code with Wrapping Wizardry hackthedeveloper.com

Python decorators are powerful tools for enhancing the behavior and flexibility of your code. The article covers everything from the basics to advanced topics, making it a great learning resource.

  1. Three Hands-On Project Tutorials:
  • How to Make a Telegram Bot with Python (English): Build a Telegram bot, with the tutorial using Tornado as the backend and deploying the project on Render.
  • Implement DNS in a Weekend with Python (English): The tutorial guides you through implementing a DNS resolver with a total codebase of only about 200 lines, but the author provides a wealth of learning resources and code explanations that you'll definitely learn a lot from. Plus, there are 7 practice problems at the end of the tutorial to further develop the functionality of the DNS resolver. (Julia Evans is a treasure, check out her blog, website, pandas-cookbook, and more, highly recommended!!!)
  • Build Your Own Git with Python (English): I'm giving this project full marks! The tutorial website is uniquely and coolly designed, starting with a minimum viable product and gradually adding code, guiding you step-by-step through implementing various Git features. Each chapter uses Git's diff to show you exactly what code has been added or removed, which is very conscientious and I doubt you'll find a second one like it on the whole internet!

🎁 Python Trending Weekly 🎁 organizes its content into seasons, with every 30 issues forming a season. The highlights from the first season have been compiled for your convenience. You can access them online here (Chinese).

Image of Building Your Own Git
🐿️

Projects & Resources

× 9
01 frogmouth: A tool for browsing Markdown in your terminal github.com

frogmouth can open md files from local or URL, and it features a browser-like navigation bar, history, bookmarks, and table of contents.

02 Python GUI for Image Segmentation with Meta AI's SAM github.com

A Python desktop application that provides a graphical user interface for Meta's AI model SAM, which can extract objects from photos.

03 GirlfriendGPT: Your AI Companion github.com

Do you have a girlfriend? This starter project uses ChatGPT to build an AI companion, complete with a personalized personality, voice, and selfie!

04 Python Evolution.pptx slideshare.net

A PPT presentation of a technical sharing session that introduces the optimizations in Python 3.7-3.11 in terms of performance, type experience, and developer experience.

Python Interpreter Optimization
05 soundstorm-pytorch: SoundStorm implementation in Pytorch github.com

SoundStorm is an efficient non-autoregressive parallel audio generation model newly proposed by Google Deepmind. soundstorm-pytorch is a Pytorch implementation of this model.

06 asynq: Python's Asynchronous Programming Library github.com

asynq is an asynchronous programming library developed by Quora, which focuses on batching requests to external services. For storage services like memcache and redis, it is much faster to make a single request to fetch multiple keys than to make multiple requests to fetch one key at a time.

07 Propan: Powerful and easy-to-use Python async web framework github.com

An async framework based on pydantic, fastapi, and pytest, which simplifies the code integration of MQ and provides a useful development toolkit. It is characterized by the design based on Messaging Architecture, so it is also a declarative MQ framework.

08 talkGPT4All: A Voice Chatbot Based on GPT4All vra.github.io

It uses OpenAI's Whisper model to convert the user's input speech to text, then calls GPT4All's language model to get the response text, and finally uses a text-to-speech (TTS) program to read the response text aloud.

09 lightly: A Python Library for Self-Supervised Learning of Images github.com

This is a computer vision framework for self-supervised learning, written in a PyTorch-like style and supporting distributed training with PyTorch Lightning.

Image of an overview of related concepts
🐢

Podcasts & Videos

× 6
01 Indie Hackers: Hard to Make Money as an Indie Developer? You Need the Right Build Strategy xiaoyuzhoufm.com

Explored the build in public strategy most commonly used by indie developers overseas. I resonated with this episode a lot and plan to share some of this week's data, the creative process of the weekly, my personal knowledge input, and creative system soon.

02 Beyond the Code: Leaving Microsoft, Life Is About Experience? The Meaning of Reading, Active and Passive Life xiaoyuzhoufm.com

This is a newly launched casual talk show podcast for programmers. The topics are casual, but there are often touching segments. The first episode is shared here, and it has been updated to the third episode. The guest of the third episode is Evan You, the author of Vue!

03 Changelog #526: Git with your friends changelog.com

This podcast talks about some Git tools, such as Git-Heat-Map, Git-Sim, git-bug, GitUI, etc. Since two of the tools are written in Python, they also talk about the topic of installing Python dependencies. Brett Cannon wrote a blog post in response to the hosts' incorrect usage, mainly introducing pipx, .pyz files, and the proper use of system package managers.

04 #418: How to Keep a Secret in Python Apps talkpython.fm

This episode of "Talk Python To Me" explores how to handle sensitive information that your application needs to use, and also talks about password management solutions for everyday personal use. Coincidentally, I also saw an article this week called "2023-21: My 1Password Key Management Practices", which gives a systematic introduction to password management, SSH/Shell integration, CI/CD applications, and more.

05 Andrew Ng's Three New Generative AI Courses deeplearning.ai

Build systems with OpenAI's ChatGPT API, develop LLM applications with LangChain, and learn how diffusion models work.

06 Three MIT courses on Python twitter.com

Free MIT courses: Introduction to Computer Science and Programming in Python, Classical Machine Learning, Deep Learning.

ESC
↑↓ select · ↵ open175 issues