PythonHub
2.37K subscribers
2.35K photos
49K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
TypeIs does what I thought TypeGuard would do in Python

The article discusses the differences between the TypeGuard and TypeIs type annotations in Python. It explains that TypeIs has more intuitive behavior compared to TypeGuard, especially when dealing with union types, and recommends using TypeIs over TypeGuard in most cases.

https://rednafi.com/python/typeguard_vs_typeis/
Sleepsort: Sorting while sleeping

The post introduces the "sleepsort" algorithm, a quirky sorting method that utilizes thread sleep times to sort integers in ascending order. It provides a playful yet insightful exploration of the algorithm's functionality and limitations.

https://animeshchouhan.com/posts/sleepsort
How to Build a Crystal Image Search App with Vector Search

A demonstration of how to build an application to store and query data on crystals and precious stones using Astra DB. Built with RAGStack, this web app leverages the CLIP model to provide multi-modal search to retrieve data on all kinds of crystals.

https://www.datastax.com/blog/building-a-generative-ai-crystal-image-search-app-with-vector-search
A Beginner’s Guide to Vector Embeddings

In this article, we’ll examine vector embeddings in depth, including the types of vector embeddings, how neural networks create them, how vector embeddings work, and how you can create embeddings for your data.

https://www.timescale.com/blog/a-beginners-guide-to-vector-embeddings/
Django: An admin extension to prevent state leaking between requests

Here’s a small protection I added to a project a few years ago. I was considering it again since I saw a similar potential bug in a Django middleware.

https://adamj.eu/tech/2024/04/29/django-admin-prevent-leaking-requests/
Poor mans autoreload server in single file python on linux

The article describes a simple Python server that provides automatic browser page reload on content change, without requiring any additional setup or configuration. The server acts as a regular file server but also serves WebSocket messages over a specified path to trigger the page reload.

https://hereket.com/posts/linux_live_reload_python_server/