
Articles, projects and tutorials about #Python. Weekly newsletter: https://xitter.cf/t.co/yAyJfZX43G
Joined September 2021
- Tweets4.5K
- Following35
- Followers767
- Likes229
Python Weekly 🐍 retweeted
Django 5.0 released
djangoproject.com/weblog/202…
Python Weekly 🐍 retweeted
Python Multiprocessing Pool: Complete API Guide
superfastpython.com/multipro…
Discussions: discu.eu/q/https://superfast…
#programming #python
by @SuperFastPython
Python Weekly 🐍 retweeted
The 7.1.0 release is out 🎉
Massive shoutout to all the contributors. 🙌
ibis-project.org/release_not…
1/n Highlights:
- read_parquet, read_csv, read_json for #BigQuery
- Table sampling using t.sample()
- @duckdb fsspec support (enabling among other things GCS reads)
Python Weekly 🐍 retweeted
Director.... Animator....Occasional Nude organist & flower arranger...
Happiest of birthdays to our very own Terry Gilliam, who turns 83 today!
#HappyBirthday #Birthday #TerryGilliam #FlyingCircus #Director
Python Weekly 🐍 retweeted
We are excited to announce that PyCon Italia 2024 is back in Florence from the 22nd to the 25th of May 2024! 🇮🇹
Our website is now up with the upcoming dates for our CFP, Grants, tickets and more!
Mark your calendar! buff.ly/3GajwVe 🐍
Python Weekly 🐍 retweeted
Announcing ✨compiled✨
🐍They're *2-3x faster* variants of Python's standard library modules.
Read more about them here: github.com/pycompiled/compil…
Python Weekly 🐍 retweeted
🐍 Python Database Tutorials — This section contains all of our tutorials that are related to working with databases in #Python.
realpython.com/tutorials/dat… realpython.com/tutorials/dat…
Python Weekly 🐍 retweeted
We are proud to announce that we have completed PyPI's first external security audit.
blog.pypi.org/posts/2023-11-…
Python Weekly 🐍 retweeted
Talk by my coworker (and co core dev) Brandt Bucher on how we plan a JIT for Python 3.13. youtu.be/HxSHIpEQRjs
Python Weekly 🐍 retweeted
Why and How CPython use Bloom Filters inside some of its String APIs, such as splitlines and strip?
Let's take a tour of CPython internals to understand the use of bloom filters within CPython's string APIs and to see how it implements the bloom filter.
Use of Bloom FIlters in splitlines():
The splitlines() API is used to split a string by lines. Naturally, it needs to scan the string character by character and check if it is a line break character.
This would have been straightforward if there was only one way to represent line breaks, e.g. '\n'. However, as it turns out there are 8 different code points in Unicode to represent a new line.
Now, doing 8 comparisons for each character when most of them are going to result in a negative answer is expensive. We can't afford this in applications processing large amounts of data.
Using a set would be an obvious option but they require hash functions, which can be costly when performed so frequently.
Instead, CPython employs a bloom filter to do this. Yes, a bloom filter also requires hash function(s). However, CPython devs have implemented it in a clever manner which circumvents any hash computation whatsoever. Sounds curious, isn't it? If you are interested in learning how they do it, keep reading!
Now, using a bloom filter for checking line break characters is fast because for majority of characters the answer is negative. And, if the answer turns out to be positive, CPython does a full comparison against all 8 possible line break chars. The following illustration shows the code.
Use of Bloom Filters in strip() API:
Similarly, CPython uses bloom filters in the strip API. The strip method removes specified characters from the start, end, or both ends of a string. It takes the list of characters to be removed as a parameter and there is no limit on how many characters you can specify.
As the size of the set of characters to be stripped is potentially unbounded, comparing against every member of this set is impractical. Therefore, CPython uses a bloom filter as a first point of check which can quickly return negative. In case it does give a positive result, then CPython needs to do a full comparison.
The following listing shows the code for the strip API implementation from CPython code.
Bloom Filter Implementation in CPython:
Now, coming to how CPython implements bloom filter such that it avoids expensive hash functions? The following listing shows the full C code, which is < 50 lines.
I have annotated it to explain what's happening. But the key points are:
- It uses an unsigned long value as the bit vector. It gives 64 bits on 64-bit hardware which is sufficient for storing characters of a string
- Instead of using expensive hash functions, it uses lower n-bits of the character and sets the corresponding bits on in the bit vector to add the character
- On 64 bit hardware, it uses lower 6 bits of each character, whereas on 32 bit hardware it uses lower 5 bits.
This was a curtailed version of my latest article. In the article I break down the CPython code explain the bloom filter implementation piece by piece. Check it out (link in the replies).
Python Weekly 🐍 retweeted
Hey, do you know the @ThePSF is hiring for a full-time position called the Deputy CPython Developer in Residence?
It's a special role where you'd work with me and the rest of the core team on directly shaping the future of #Python.
Want to know more?
lukasz.langa.pl/40b601fc-2b2…
Python Weekly 🐍 retweeted
Here it is: the FastAPI Reference - Code API in the docs. ✨
One of the most awaited requests from many users. 🔥
FastAPI 0.104.0 🔖
fastapi.tiangolo.com/referen…
Python Weekly 🐍 retweeted

Charlie Marsh@charliermarsh16 Oct 2023
United States
United StatesConnected via United States App StoreAccount-level information, not a live location or per-post device.
Ruff v0.1.0 is out now.
This release is all about stabilization.
Given Ruff's rapid growth, we're introducing new features to better reflect Ruff's maturity and make life easier for our users as we continue to iterate.
astral.sh/blog/ruff-v0.1.0
Python Weekly 🐍 retweeted
Announcing DjangoCon Europe 2024 in Vigo, Spain! 🇪🇸
djangoproject.com/weblog/202…
Python Weekly 🐍 retweeted
Why not tell people to "simply" use pyenv, poetry or anaconda
bitecode.substack.com/p/why-…
Discussions: discu.eu/q/https://bitecode.…
#programming #python
Python Weekly 🐍 retweeted
Seeking Feedback on My First Django Project
github.com/Rizque/GreenValle…
Discussions: discu.eu/q/https://github.co…
#django #programming #python #webdev
Python Weekly 🐍 retweeted
Google finds faster sorting algorithm using deep reinforcement learning
nature.com/articles/s41586-0…
Discussions: discu.eu/q/https://www.natur…
#artificial #programming
Python Weekly 🐍 retweeted
How to structure a project that contains C++ and Python code
github.com/smrfeld/cmake_cpp…
Discussions: discu.eu/q/https://github.co…
#cpp #learnpython #programming #python
Python Weekly 🐍 retweeted
ReactPy: Build ReactJS Interfaces in Pure Python
github.com/reactive-python/r…
Discussions: discu.eu/q/https://github.co…
#programming #python
by @reactpy
Python Weekly 🐍 retweeted
Plan to Have a Python Bindings for My App Written in Go
github.com/hkpeaks/peaks-con…
Discussions: discu.eu/q/https://github.co…
#golang #programming #python




















