PythonHub
2.49K subscribers
2.35K photos
49.9K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
Invent your own comprehensions in Python

Python doesn't have tuple, frozenset, or Counter comprehensions, but you can invent your own by passing a generator expression to any iterable-accepting callable.

https://www.pythonmorsels.com/custom-comprehensions/
Avoiding empty strings in non-nullable Django string-based model fields

Django allows empty strings ('') even on non-nullable string fields, so you must explicitly enforce non-empty values using validation or database constraints rather than relying on null=False. The post argues for treating empty strings as invalid at the model or DB level (e.g., validators or CHECK constraints) to ensure true “required” semantics for string fields.

https://peateasea.de/avoiding-empty-strings-in-non-nullable-django-string-based-model-fields/
The Slow Collapse of MkDocs

How personality clashes, an absent founder, and a controversial redesign fractured one of Python's most popular projects.

https://fpgmaas.com/blog/collapse-of-mkdocs/
Stop Passing Primitives Everywhere (Use Value Objects)

By replacing primitives with immutable Value Objects, you can centralize validation and eliminate domain ambiguity for types like prices and percentages. This pattern ensures that invalid states are impossible to represent, creating a self-documenting and more reliable codebase without the overhead of heavy frameworks.

https://www.youtube.com/watch?v=CWYwz3iV1g0
Build a smart financial assistant with LlamaParse and Gemini 3.1

Learn how to extract high-quality data from complex, unstructured PDFs using LlamaParse powered by Gemini 3.1 Pro. This guide demonstrates an event-driven workflow to automate the parsing of dense financial tables and generate intelligent summaries with Gemini 3.1 Flash. Perfect for developers building scalable document-parsing pipelines and AI personal finance assistants.

https://developers.googleblog.com/build-a-smart-financial-assistant-with-llamaparse-and-gemini-31/