PythonHub
2.55K subscribers
2.35K photos
50.2K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
Hamiltonian Neural Networks from a Differential Geometry Perspective

The post explains Hamiltonian Neural Networks through differential geometry, showing why a normal MLP can fit motion data but still invent or lose energy over long rollouts. It shows that by learning a scalar Hamiltonian and deriving motion through the symplectic gradient, HNNs make energy conservation structurally unavoidable instead of hoping the network learns it from data.

https://abscondita.com/blog/symplectic-sledgehammer-for-a-spring
Miles: A PyTorch-Native Stack for Large-Scale LLM RL Post-Training

Miles is an open source PyTorch-native framework for large-scale LLM reinforcement-learning post-training, combining SGLang for rollouts, Megatron-LM for training, Ray for orchestration, and PyTorch for extensibility. The post explains how Miles handles the hard systems problems behind frontier RL, including async rollout/training, fast weight sync, MoE alignment, low-precision recipes, ...

https://pytorch.org/blog/miles-a-pytorch-native-stack-for-large-scale-llm-rl-post-training/
PEP 814: Add frozendict built-in type

The post explains the path from rejected PEP 416 and stalled PEP 603 to accepted PEP 814, which adds a built-in frozendict type to Python 3.15. It covers how frozendict works, why it is hashable only when values are hashable, where the standard library now supports it, and what C/Python code may need to update.

https://vstinner.github.io/pep-814-add-frozendict-builtin-type.html
Sandboxing an AI Agent

The post explains why autonomous AI agents should run in isolated sandboxes instead of directly on a developer’s laptop, especially as agents gain auto-approval, long-running tasks, file access, and network access. It compares sandbox architectures, from tool-backend setups to agents living fully inside the sandbox, and explains the tradeoffs across security, secrets, streaming, performa...

https://sajalsharma.com/posts/sandboxing-an-ai-agent/
Celery on AWS ECS - Complete Guide

The post explains why running Celery on AWS ECS can cause lost, delayed, duplicated, or never-completed tasks due to ECS shutdown behavior, Celery defaults, prefetching, and timeout edge cases. It recommends safer production settings, shorter/idempotent task design, fan-out or batching, RabbitMQ on Amazon MQ, and Redis-based locking to make Celery workers more reliable on ECS.

https://jangiacomelli.com/blog/celery-on-aws-ecs/
An Intro to Spiel – Creating Presentations in Your Terminal with Python

The post introduces Spiel, an archived Python package that uses Rich to create and run slide presentations directly inside the terminal. It walks through installing Spiel, running the demo, and building simple terminal-based slides with Deck, Slide, decorators, and keyboard navigation.

https://blog.pythonlibrary.org/2026/07/10/an-intro-to-spiel-creating-presentations-in-your-terminal-with-python/