Your Python program can stop entirely for several seconds. This is caused by the garbage collector cleaning up the memory.
Importantly, it can happen even if you are not allocating and deallocating a lot of memory. And the pause is not caused by the cleaning up of the memory.
All that is required is that your program has, at some point, allocated lots of objects. Even if these objects are retained, the problem will remain.
Python does offer you the tools to deal with the problem, and your favorite AI will tell you all about it if you ask.
Oh, so we're going to talk about stopped world pauses in Python. So to illustrate that potential problem, I'm going to use a standard linked list. So initially my program, I create a very large linked list and then within a loop and it's not going to get deallocated. And then within a loop I create small data structures. And so to this trade here, I'm going to use a star Linux server and a recent, relatively recent Python version. And and then my script initially just generates the big linked list, which takes a long time. Now this big linked list is going to stay allocated throughout. So it's not deallocating this link that this list that's a problem. And and of course my my results depend on your configuration now here. Now you can see initially the pauses are quite short, so maybe 5 millisecond which is not too bad and then eventually you get the big problems. In my case it goes up to 2.8. Now this is not if I run it several times that the results will differ differ. You can work around these issues. By configuring the garbage collector, but ever produced this on a wide range of system?
New built-in type coming to Python: frozendict, an immutable dictionary
This change is coming in Python 3.15, scheduled to be released in October of 2026.
Say you have a `frozendict` instance.
Trying to modify an existing key/value pair or adding a new key raises a `TypeError`:
```pycon
>>> fd = frozendict({"one": 2})
>>> fd["one"] = 1
TypeError
>>> fd["two"] = 2
TypeError
```
It's also worth noting that the immutability of a frozen dictionary is shallow.
You can still mutate the underlying values:
```pycon
>>> fd = frozendict({"list": []})
>>> fd
frozendict({'list': []})
>>> fd["list"].append(73)
>>> fd
frozendict({'list': [73]})
```
Remember that this behaviour matches the behaviour of a tuple!
What will you use this for?
Create another palindrome use is_palindrome() method in python but use swap index of each char to reverse all index from backword. Notice if the length of the word or number not the same is false.
py check_palindrome.py
Enter a word or numbers: madam
True
Enter a word or numbers: python
False
Enter a word or numbers: 101
True
How Python Decides What Runs Next?
Python follows a control flow to decide what runs next — by default it executes statements sequentially from top to bottom, but conditional statements (if/elif/else) and loops (for, while) change that flow based on decisions and repetition.
Understanding this lets you predict exactly how and in what order your Python code runs.
Learn from this video : https://lnkd.in/dmRxXPVF
Something interesting happens when you check membership in a Python dictionary.
Whereas checking for membership using the keys of a dictionary runs in O(1) average time, the same runs in O(n) time if you use the values of the same dictionary.
Here is why:
Dictionary keys are stored in a hash table. Python hashes the key and uses that hash to locate the correct bucket in constant time.
For values, Python has to draw lightweight view object and then traverse it till it finds the value.
Checking values in a loop over a big dictionary can quietly become a performance bottleneck.
I have attached code to illustrate this.
I’ve wanted to write something in Rust for a while, and recently got a bit excited about the idea of a Python library in Rust. So I open-sourced fast-ordset - an ordered set for Python implemented in Rust (PyO3 + indexmap).
In benchmarks it’s about 2–10× faster than the pure-Python ordered-set on various operations. The extension is thread-safe and doesn’t hold the GIL, so it works with free-threaded Python.
One downside: iteration is noticeably slower - each element crosses the Rust→Python boundary (serialization/copying), so for x in s and list(s) are slower than the Python implementation. For indexing s[i] and bulk operations it’s fine.
Install: uv sync --all-extras and uv run maturin develop --release. MIT license.
Repo: https://lnkd.in/dXRXdWqY#Python#Rust#OpenSource
Python 🐍: pip: HowTos: Get Package Versions Available and Installed Version
Here’s a quick way to get all versions available of a particular package as well as, the latest and installed versions.
pip index versions package-name
#python#pip#pythonhowtos#pipindex
How Python Decides What Runs Next?
Python follows a control flow to decide what runs next — by default it executes statements sequentially from top to bottom, but conditional statements (if/elif/else) and loops (for, while) change that flow based on decisions and repetition.
Understanding this lets you predict exactly how and in what order your Python code runs.
Learn from this video : https://lnkd.in/dWtrff9E
Solved problem 347 in Leetcode!
Solution Python:
class Solution:
def topKFrequent(self, nums: List[int], k: int) -> List[int]:
count_nums = {}
for num in nums:
count_nums[num] = count_nums.get(num, 0) + 1
array_nums = [[] for i in range(len(nums) + 1)]
for num, count in count_nums.items():
array_nums[count].append(num)
result = []
for i in range(len(nums), 0, -1):
for num in array_nums[i]:
result.append(num)
if len(result) == k:
return result
Python Starters Day 19 Foundation Nugget
For continuity, use While Loops
While loops repeat until something changes.
count = 0
while count < 5:
print(count)
count += 1
Be careful with the condition, because if the condition does not change, then the loop will never stop.
This teaches responsibility, as automation without control can cause chaos.
Loops must have an exit.
Follow the Python 🐍 Starters Hub:
WhatsApp: https://lnkd.in/dbjAFv52
LinkedIn: https://lnkd.in/dkJE3tZq
Website: https://lnkd.in/eBHB2MqY
Daniel Lemire, "How bad can Python stop-the-world pauses get?," in Daniel Lemire's blog, February 15, 2026, https://lemire.me/blog/2026/02/15/how-bad-can-python-stop-the-world-pauses-get/.