PythonHub
2.31K subscribers
2.35K photos
48.9K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
A leap year check in three instructions

The article explores how to check if a year is a leap year using just three CPU instructions, leveraging clever bit manipulation and "magic numbers" to optimize the standard algorithm. By reverse-engineering and brute-forcing constants, the author demonstrates a branchless, highly efficient leap year check for years up to 102,499, illustrating both the mathematical tricks and practical l...

https://hueffner.de/falk/blog/a-leap-year-check-in-three-instructions.html
AlphaEvolve: A coding agent for scientific and algorithmic discovery

AlphaEvolve is an autonomous coding agent that uses evolutionary strategies to improve algorithms by iteratively modifying code and learning from evaluator feedback. It has achieved breakthroughs in data center scheduling, hardware design, and mathematical discovery—including surpassing Strassen’s 4×4 matrix multiplication algorithm for the first time in 56 years.

https://storage.googleapis.com/deepmind-media/DeepMind.com/Blog/alphaevolve-a-gemini-powered-coding-agent-for-designing-advanced-algorithms/AlphaEvolve.pdf
A Python frozenset interpretation of Dependent Type Theory

The post explores modeling dependent type theory (DTT) concepts using Python’s frozenset data structure, treating types as finite sets to clarify complex type-theoretic ideas. By implementing type constructors like dependent sums (Σ), dependent products (Π), and identity types in Python, the author demonstrates how key DTT judgments and structures can be represented and reasoned about in...

https://www.philipzucker.com/frozenset_dtt/
Flask Wiki

A community-driven wiki for learning Flask.

https://flaskwiki.wiki/
Python Tutorial: Type Hinting vs Type Checking vs Data Validation - What’s the Difference?

In this video, we'll be learning about the differences between type hinting, type checking, and data validation in Python. These are three concepts that many developers get confused about, so we'll cover what each one does, when to use them, and how they work together. We'll also look at practical examples using tools like mypy for type checking and Pydantic for data validation. By the e...

https://www.youtube.com/watch?v=fM4O9bModsE
Traffic meter per ASN without logs

The author introduces asncounter, a Python tool that analyzes logs or network traffic to count and group incoming IPs by their Autonomous System Number (ASN), helping identify which organizations are generating the most traffic. It’s designed for quick deployment and practical insight—especially when logs are anonymized or attackers use distributed IPs—making it easier to spot patterns, ...

https://anarc.at/blog/2025-05-30-asncounter/
No GPU left behind: Unlocking Efficiency with Co-located vLLM in TRL

Hugging Face’s new co-location feature lets vLLM inference and model training share the same GPUs and process group, eliminating idle GPU time and costly hardware overhead that plagued the old server-based setup. This integrated approach delivers up to 1.73X faster throughput for large language models, maintains model quality, and simplifies scaling—though it requires careful GPU memory ...

https://huggingface.co/blog/vllm-colocate