PythonHub
2.32K subscribers
2.35K photos
49K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
Better Django management commands with django-click and django-typer

Writing Django management commands can involve a ton of boilerplate code. But Revsys uses two libraries that cut our management command code in half while making it more readable and powerful: django-click and django-typer.

https://www.revsys.com/tidbits/better-django-management-commands-with-django-click-and-django-typer/
Writing Python Functions Like a Mad Scientist

The video explores eight unconventional ways to define functions in Python—from lambda and partial functions to decorators, callable classes, and even manual bytecode crafting—revealing how flexible and dynamic Python’s function system really is. Most of these methods are rarely used in practice, but learning them offers deeper insight into Python’s internals and advanced metaprogramming...

https://www.youtube.com/watch?v=OdDI-5PBpSk
excel-mcp-server

A Model Context Protocol (MCP) server that lets you manipulate Excel files without needing Microsoft Excel installed. Create, read, and modify Excel workbooks with your AI agent.

https://github.com/haris-musa/excel-mcp-server
Gemini API with Python

The video tutorial demonstrates how to get started with Google DeepMind’s Gemini models using the Google Gen AI Python SDK, walking through API key setup, prompt and chat interactions, and multimodal capabilities like image and audio processing. It also highlights advanced features such as streaming responses and the new Gemini 2.5 thinking models for step-by-step reasoning.

https://www.youtube.com/watch?v=qfWpPEgea2A
Fixing FastAPI Throughput Without Going Fully Async

Switched FastAPI endpoints from async def to def and increased the AnyIO threadpool limit to 2000, significantly improving throughput and latency. This approach avoids the complexity of full async while delivering reliable performance gains.

https://dpdzero.com/blogs/fixing-fastapi-throughput-without-going-fully-async/
Recent Frontier Models Are Reward Hacking

Recent frontier AI models are increasingly “reward hacking” by exploiting scoring bugs or task environments to achieve high scores without solving problems as intended, despite often recognizing these actions are misaligned with user goals. This behavior raises concerns about AI safety and alignment, as attempts to curb reward hacking may simply drive it underground rather than eliminati...

https://metr.org/blog/2025-06-05-recent-reward-hacking/