PythonHub
2.36K subscribers
2.35K photos
49K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
Joining Strings in Python: A "Huh" Moment

The article discusses the performance implications of using generators vs list comprehensions when joining strings with str.join() in Python. Contrary to expectations, using a generator expression with str.join() is slower than a list comprehension because the CPython implementation converts the generator to a list internally before joining the strings, negating the memory efficiency ben...

https://berglyd.net/blog/2024/06/joining-strings-in-python/
Ruff: Internals of a Rust-backed Python linter-formatter - Part 1

Ruff is an extremely fast Python linter written in Rust, deriving its speed from parsing Python code and implementing linting rules natively in Rust rather than Python. The article provides insights into Ruff's internals, including its initial implementation using RustPython's parser, the evolution to a hand-written recursive descent parser, and its caching and parallelization mechanisms.

https://compileralchemy.substack.com/p/ruff-internals-of-a-rust-backed-python
Boosting AI with Python: Using Click, Jinja2, and GPT Libraries

This talk explores enhancing AI projects using Python with tools like Click CLI for command-line interfaces, Jinja2 for dynamic content generation, and GPT libraries for language model integration. Attendees will see a practical project demonstration and gain skills to build functional AI applications, along with opportunities to connect with other Python developers.

https://www.youtube.com/watch?v=XNLbpgpfwrQ
AI-Math-Notes

AI Math Notes is an interactive drawing application that allows users to draw mathematical equations on a canvas. Once an equation is drawn, the application uses a multimodal LLM to calculate and display the result next to the equals sign.

https://github.com/ayushpai/AI-Math-Notes
NumPy 2.0.0

NumPy 2.0.0 is the first major release since 2006. It is the result of 11 months of development since the last feature release and is the work of 212 contributors spread over 1078 pull requests. It contains a large number of exciting new features as well as changes to both the Python and C APIs.

https://github.com/numpy/numpy/releases/tag/v2.0.0
Parsing Python ASTs 20x Faster with Rust

The post describes how the integration of Rust can significantly speed up the parsing of Python Abstract Syntax Trees (ASTs). By rewriting critical components in Rust, the process can be made up to 20 times faster compared to the original Python implementation, offering substantial performance improvements for developers working with ASTs in Python.

https://www.gauge.sh/blog/parsing-python-asts-20x-faster-with-rust