atlas news
  Peterbe : Python
01  april     13h20
pytest import file mismatch
   Make sure your test files in a pytest tested project sit in directories with a init .py
06  march     15h27
logger.error or logger.exception in Python
   Consider this Python code:try: 1 0except Exception as e: logger.error("An error occurred while dividing by zero.: %s", e)The output of this...
18  december     09h46
Autocomplete using PostgreSQL instead of Elasticsearch
   Here on my blog I have a site search. Before you search, there’s autocomplete. The autocomplete is solved by using downshift in React and on the...
15  december     23h37
Comparison of speed between gpt-5, gpt-5-mini, and gpt-5-nano
   gpt-5-mini is 3 times faster than gpt-5 and gpt-5-nano.
12  november     12h42
Using AI to rewrite blog post comments
   Using AI to correct and edit blog post comments as part of the moderation process.
10  october     13h07
In Python, you have to specify the type and not rely on inference
   Unlike TypeScript, if you give a variable a default, which has a type, that variable is implied to always have the type of the default. That’s not...
28  august     12h11
Faster way to sum an integer series in Python
   You can sum a simple series with n(n 1) 2
09  august     18h33
Combining Django signals with in-memory LRU cache
   It’s easy to combine functools.lru cache with Django signals to get a good memoization pattern on Django ORM queries.
25  june     21h36
Native connection pooling in Django 5 with PostgreSQL
   Enabling native connection pooling in Django 5 gives me a 5.4x speedup.
12  june     20h25
A Python dict that can report which keys you did not use
   Demonstrates a basic way, in Python, how to know which fields of a dict you never accessed.
1781265053