The Curious Engineer

All blogs / Python

mathspp blog

mathspp.com/blog

All of the mathspp blog articles about Python, programming, and mathematics.

PythonMathDev tools / editors / IDEs

Posts
436 from 11 Oct 2017 to 30 Oct 2026
Posting
weekly (42 in the last year)
Kind
personal blog

2026 36

  1. Python abi3t: what is it?
  2. Thread-safe iterators
  3. 4 upgrades to the Python standard library in 3.15
  4. Typing improvements in Python 3.15
  5. TypedDict with extra items
  6. Module profiling overview
  7. Tachyon: sampling profiling in Python
  8. DX improvements in Python 3.15
  9. Startup configuration files
  10. Unpacking inside comprehensions
  11. frozendict built-in
  12. sentinel built-in
  13. Explicit lazy imports
  14. The 5 most exciting new features of Python 3.15
  15. TIL #146 – Using maturin through uv
  16. Why OOP exists
  17. Python quiz: EuroPython 2026 edition
  18. itertools cheatsheet
  19. Write a coding agent from first principles: better tools
  20. Write a coding agent from first principles
  21. TIL #145 – collections.deque is implemented in blocks
  22. TIL #144 – Sentinel built-in
  23. TIL #143 – Resolve a lazy import manually
  24. Personal highlights of PyCon Lithuania 2026
  25. Who wants to be a millionaire: iterables edition
  26. uv skills for coding agents
  27. Indexable iterables
  28. Ask the LLM to write code for it
  29. Cyclic trapezoid animation
  30. TIL #142 – Cyclic quadrilateral
  31. TIL #141 – Inspect a lazy import
  32. TIL #140 – Install Jupyter with uv
  33. TIL #139 – Multiline input in the REPL
  34. Remove extra spaces
  35. Recursive structural pattern matching
  36. TIL #138 – Custom directives in Jupyter Book

2025 58

  1. Generalising itertools.pairwise
  2. TIL #137 – Inline SVGs in Jupyter notebooks
  3. Floodfill algorithm in Python
  4. TIL #136 – Publish an EPUB book with Jupyter Book
  5. Module compression overview
  6. A generator, duck typing, and a branchless conditional walk into a bar
  7. TIL #135 – Build the Python documentation
  8. Functions: a complete reference | Pydon't 🐍
  9. TIL #134 – = alignment in string formatting
  10. TIL #133 – Shoelace formula
  11. TIL #132 – Double factorial
  12. uv cheatsheet
  13. TIL #131 – Change casing in search & replace
  14. Accepting the PSF Community Service Award
  15. functools.Placeholder
  16. TIL #130 – Format Python code directly with uv
  17. TIL #129 – Custom value in dict.fromkeys
  18. Personal highlights of EuroPython 2025
  19. PyCon Portugal 2025 programme mafia
  20. TIL #128 – Matching prefixes and suffixes with regex
  21. TIL #127 – Dynamically changing the type
  22. TIL #126 – Hash of infinity
  23. Python quiz: EuroPython 2025 edition
  24. TIL #125 – Images in docstrings
  25. Regex in real life
  26. Personal highlights of PyCon Italy 2025
  27. Python quiz: PyCon Italia 2025 edition
  28. Dipping my toes in metaprogramming
  29. Who wants to be a millionaire?
  30. TIL #124 – Thousands separators
  31. Personal highlights of PyCon US 2025
  32. Automatically pushing code changes during live coding with uv
  33. TIL #123 – The appearing built-in
  34. TIL #122 – CLI tools with extra dependencies
  35. Module enum overview
  36. TIL #121 – uv escape hatch
  37. TIL #120 – Circle vs rectangle collision detection
  38. Binary search as a bidirectional generator
  39. JavaScript 2D scrolling game tutorial
  40. TIL #119 – Co-authored commits
  41. TIL #118 – git checkout -
  42. TIL #117 – Publishing a Python package with uv
  43. Beating LinkedIn “Queens” with Python
  44. Building a Python compiler and interpreter – 10 elif and else
  45. Using uv to build and install Python CLI apps
  46. Ignoring exceptions with contextlib.suppress
  47. TIL #116 – Run commands inside Jupyter notebooks
  48. TIL #115 – Nested Easter eggs
  49. TIL #114 – Implicit casting in dataframe concatenation
  50. TIL #113 – Standalone executable Python scripts with uv
  51. Using an LLM to write a countdown timer
  52. TIL #112 – re.Match.groupdict
  53. functools.cmp_to_key
  54. Decorators | Pydon't 🐍
  55. TIL #111 – Interrupting scripts without tracebacks
  56. TIL #110 – Hash of -1 is -2
  57. Animating a tree fractal
  58. TIL #109 – Unpacking kwargs with custom objects

2024 49

  1. Reverse-engineering the “Chronospatial Computer”
  2. TIL #108 – Date sequences in Polars
  3. Solving “Bridge Repair” in 4ms with Python
  4. TIL #107 – Automatically activating virtual environments
  5. Parsing TXRX files in Python
  6. TIL #106 – asyncio.gather
  7. TIL #105 – pytest selection arguments for failing tests
  8. Teaching the world's largest programming lesson
  9. How I prepare a technical talk
  10. TIL #104 – nested makefiles
  11. mutability and random.shuffle
  12. Problem #066 – regex crossword
  13. Automatic site updates with cog and pre-commit
  14. Customising object creation with __new__
  15. Case-insensitive string class
  16. Module itertools overview
  17. TIL #103 – debugging the new Python REPL with trace and PYREPL_TRACE.
  18. TIL #102 – ctrl+left and ctrl+right not working in the Python REPL on MacOS
  19. Animating a rotating spiral
  20. TIL #101 – difference between __getattr__ and __getattribute__
  21. TIL #100 – Making an iterator out of a function
  22. Breaking out of nested loops with generators
  23. TIL #099 – order values of dictionary by iterable of keys with operator.itemgetter
  24. TIL #098 – Git alias for quick commit & push
  25. ASCII rain scroll art
  26. TIL #097 – get terminal size
  27. TIL #096 – automatically push code changes during live coding
  28. Sets as dictionaries with no values
  29. TIL #095 – better test parametrisation in pytest
  30. TIL #094 – pytest.raises: parameter match
  31. A tutorial is not a long talk
  32. Hold my parentheses light: now with zero sugar
  33. Hold my parentheses
  34. 503 days working full-time on FOSS: lessons learned
  35. Longest unique substring
  36. TIL #093 – operator.methodcaller
  37. TIL #092 – dunder method __init_subclass__
  38. TIL #091 – issue user warnings
  39. Deducing physics formulas with genetic algorithms
  40. Biggest square
  41. N queens problem
  42. TIL #090 – patching module globals with pytest
  43. Python deque tutorial
  44. Problem #065 – clock synchronisation
  45. Dynamic string replacements with regex
  46. Base conversion in Python
  47. max is broken
  48. functools.partial
  49. Problem #064 – infinite mathematicians with hats

2023 81

  1. Learn pandas and matplotlib with Pokémon
  2. Manipulate Boolean values with conditions
  3. divmod for unit conversions
  4. What is *args and how do you use it?
  5. Building a Python compiler and interpreter – 09 short-circuiting
  6. Why use enums?
  7. 5 ways to flatten a list of lists
  8. TIL #089 – delete merged git branches
  9. Secret Santa draw with Python
  10. In conversation: Rodrigo and Stephen discuss analogies when learning to code
  11. Python Black Friday 2023
  12. Building a Python compiler and interpreter – 08 Booleans
  13. TIL #088 – Python's soft keywords
  14. TIL #087 – underscore is a soft keyword
  15. Single-line calculator
  16. Building a Python compiler and interpreter – 07 if
  17. Building a Python compiler and interpreter – 06 variables
  18. Building a Python compiler and interpreter – 05 statements
  19. Building a Python compiler and interpreter – 04 arithmetic
  20. Building a Python compiler and interpreter – 03 visitor pattern
  21. Building a Python compiler and interpreter – 02 numbers
  22. TIL #086 – run custom code on Python start-up
  23. Building a Python compiler and interpreter
  24. itertools.batched
  25. TIL #085 – negative zero -0.0
  26. TIL #084 – type statement and type aliases
  27. Adding stats to my blog
  28. TIL #083 – sentinel value for default arguments
  29. (More) Animations from first principles
  30. Animations from first principles
  31. TIL #082 – 20 million lines of Python code
  32. TIL #081 – find commits that affected a file
  33. TIL #080 – how to draw a Bézier curve
  34. TIL #079 – Textual app notifications
  35. TIL #078 – context variables
  36. Module pathlib overview
  37. TIL #077 – piece table data structure
  38. What learning APL taught me about Python
  39. TIL #076 – Hypothesis for code refactoring
  40. TIL #075 – Damerau-Levenshtein distance
  41. Overloading arithmetic operators with dunder methods | Pydon't 🐍
  42. All functions return something
  43. TIL #074 – crazy Python indentation
  44. TIL #073 – customise the REPL on start-up
  45. TIL #072 – read bytecode from a .pyc file
  46. TIL #071 – generator method close
  47. TIL #070 – writing and running tests in Rust
  48. TIL #069 – generator membership testing
  49. Textual for beginners
  50. TIL #068 – nested git repositories
  51. TIL #067 – VS Code extension for custom syntax highlighting
  52. TIL #066 – activate virtual environment with alias
  53. TIL #065 – VS Code sticky scroll
  54. TIL #064 – open recursion
  55. Describing Descriptors | Pydon't 🐍
  56. TIL #063 – skip tests on Microsoft Windows
  57. Properties | Pydon't 🐍
  58. How to use modal screens in Textual
  59. TIL #062 – dbg! macro for debugging in Rust
  60. Write a Python module in Rust
  61. TIL #061 – debugging other modules in VS Code
  62. TIL #060 – how to rename a git branch
  63. TIL #059 – skip list data structure
  64. TIL #058 – do not cache generators
  65. TIL #057 – optimising images for the web
  66. Write your thesis in LaTeX
  67. Streaming data from Flask to HTMX using Server-Side Events (SSE)
  68. ChatGPT for quick prototyping
  69. Textual tutorial – build a TODO app in Python
  70. VS Code shortcuts for efficient Python programmers
  71. TIL #056 – invisible variables
  72. Converting RAW images into JPEG
  73. TIL #055 – xkcd plots
  74. Your first recurrent neural network (RNN)
  75. Module collections overview
  76. Finding similar photos
  77. Implementing a case-insensitive dictionary
  78. Problem #063 – arbitrarily many primes in arbitrarily big intervals
  79. Finding and fixing over 10,000 bugs on GitHub
  80. Connecting Python and Dyalog APL with sockets
  81. How to work with case-insensitive strings

2022 64

  1. Running Python inside ChatGPT
  2. TIL #054 – type hint Any
  3. TIL #053 – precision of Python floats
  4. TIL #052 – deleting a file with pathlib
  5. TIL #051 – Heron's formula
  6. TIL #050 – add a suggestion
  7. TIL #049 – edit multiple file locations in VS Code
  8. How to create a Python package in 2022
  9. Smoosh all the things
  10. Obfuscated "Hello, world!"
  11. The most obscure "Hello, world!" program
  12. Object initialisation with __init__
  13. Dunder methods | Pydon't 🐍
  14. Custom JSON encoder and decoder
  15. TIL #048 – custom JSON decoder, part 2
  16. Problem #062 – sliding coins
  17. TIL #047 – custom JSON decoder
  18. TIL #046 – custom JSON encoder
  19. Problem #061 – flower garden
  20. Problem #060 – realtor commissions
  21. TIL #045 – using JavaScript functions in PyScript
  22. TIL #044 – PyScript
  23. TIL #043 – rich traceback and exception logging
  24. TIL #042 – how to do beautiful console logging
  25. TIL #041 – how to commit part of a file with git
  26. Contributing to open source: rich 2073
  27. Problem #059 – marching pegs
  28. TIL #040 – code syntax highlighting in Microsoft PowerPoint
  29. Problem #058 – identifying light bulbs
  30. Solving Wordle with APL
  31. Why APL is a language worth knowing
  32. Look-and-say sequence
  33. TIL #039 – how to install starship
  34. TIL #038 – look-and-say sequence growth
  35. TIL #037 – pandas Series
  36. Problem #057 – how to find the circle centre
  37. TIL #036 – pandas show_versions
  38. TIL #035 – run black formatter on pre-commit
  39. TIL #034 – multi-channel transposed convolution
  40. Enumerate from first principles
  41. TIL #033 – transposed convolution
  42. Problem #056 – tennis tournament
  43. TIL #032 – t-SNE for dimensionality reduction
  44. TIL #031 – understanding SVG viewBox
  45. TIL #030 – Simpson's paradox
  46. TIL #029 – True is equal to 1
  47. Problem #055 – horse racing
  48. 50 shades of sign
  49. TIL #028 – disassemble Python.
  50. TIL #027 – get rich with Python.
  51. Elo rating system simulation
  52. TIL #026 – web apps with streamlit
  53. Problem #054 – imperfect compression
  54. TIL #025 – reversed emoji flags
  55. TIL #024 – cooking with asyncio
  56. Chatroom server tutorial
  57. TIL #023 – how to use namedtuple
  58. TIL #022 – Python module selectors
  59. Sockets for dummies
  60. TIL #021 – Spouge's formula
  61. Problem #053 – weighing the odd one out
  62. TIL #020 – open(0)
  63. TIL #019 – sockets
  64. Solving Wordle with Python

2021 90

  1. Problem #052 – chessboard domino
  2. TIL #018 – suppressing errors with contextlib
  3. Problem #051 – queens and knights
  4. Why mastering Python is impossible, and why that's ok | Pydon't 🐍
  5. Advent of Code: sonar sweep analysis
  6. TIL #017 – symmetrical indexing with bitwise inversion
  7. Problem #050 – 8 queens
  8. TIL #016 – Quicksort in functional programming
  9. Minimax algorithm and alpha-beta pruning
  10. String formatting comparison | Pydon't 🐍
  11. TIL #015 – DARPA network challenge
  12. Counting mosaics with APL
  13. Problem #049 – coin pyramid
  14. TIL #014 – reading files with pathlib
  15. Pass-by-value, reference, and assignment | Pydon't 🐍
  16. TIL #013 – dunder method __eq__
  17. Problem #048 – trick or treat
  18. Problem #047 – surgery gloves
  19. TIL #012 – At operator for matrix multiplication
  20. TIL #011 – emojis in Python with pythonji
  21. TIL #010 – generator return
  22. TIL #009 – vars
  23. Problem #046 – triangle grid
  24. TIL #008 – two pass join
  25. TIL #007 – math.nextafter
  26. Conditional expressions | Pydon't 🐍
  27. TIL #006 – file unpacking
  28. List comprehensions 101 | Pydon't 🐍
  29. TIL #005 – string unpacking
  30. TIL #004 – C3 linearisation
  31. Problem #045 – 1, 2, 3
  32. TIL #003 – ICPO rule for attribute lookup
  33. TIL #002 – fake chess AI
  34. TIL #001 – ceiling division in Python
  35. set and frozenset | Pydon't 🐍
  36. Problem #044 – send more money
  37. Boost your productivity with the REPL | Pydon't 🐍
  38. Problem #043 – Rubik's cube scrambling
  39. String translate and maketrans methods | Pydon't 🐍
  40. Naming matters | Pydon't 🐍
  41. Problem #042 – mine captcha
  42. Neural networks fundamentals with Python – student-teacher
  43. Problem #041 – canyon crossing
  44. Code style matters | Pydon't 🐍
  45. Bite-sized refactoring | Pydon't 🐍
  46. Problem #040 – the dozen puzzle
  47. Does elegance matter? | Pydon't 🐍
  48. __name__ dunder attribute | Pydon't 🐍
  49. Problem #039 – rope timer
  50. Usages of underscore | Pydon't 🐍
  51. Problem #038 – bridges of Königsberg
  52. The power of reduce | Pydon't 🐍
  53. Buffet of self-references
  54. Boolean short-circuiting | Pydon't 🐍
  55. Problem #037 - game of coins
  56. Problem #036 - huge, tiny triangle
  57. Inner workings of sequence slicing | Pydon't 🐍
  58. Mastering sequence slicing | Pydon't 🐍
  59. Problem #035 – unknown coin sides
  60. Neural networks fundamentals with Python – subtleties
  61. Idiomatic sequence slicing | Pydon't 🐍
  62. Counting passwords with automatons
  63. Sequence indexing | Pydon't 🐍
  64. Problem #034 – one question to happiness
  65. Enumerate me | Pydon't 🐍
  66. Problem #033 - syncro
  67. Let's build a simple interpreter for APL - part 4
  68. Zip up | Pydon't 🐍
  69. Problem #032 - restaurant roundtable
  70. Structural pattern matching anti-patterns | Pydon't 🐍
  71. Neural networks fundamentals with Python – MNIST
  72. Structural pattern matching tutorial | Pydon't 🐍
  73. Problem #031 - piped ants
  74. Neural networks fundamentals with Python – backpropagation
  75. Neural networks fundamentals with Python – network & loss
  76. Chaining comparison operators | Pydon't 🐍
  77. Neural networks fundamentals with Python – intro
  78. Deep unpacking | Pydon't 🐍
  79. Problem #030 - efficiency at the beach
  80. Watch out for recursion | Pydon't 🐍
  81. Truthy, Falsy, and bool | Pydon't 🐍
  82. Problem #029 - hidden key 2 🗝️🗝️
  83. str and repr | Pydon't 🐍
  84. What all promotions actually mean
  85. Assignment expressions and the walrus operator := | Pydon't 🐍
  86. Problem #028 - hidden key 🗝️
  87. EAFP and LBYL coding styles | Pydon't 🐍
  88. Unpacking with starred assignments | Pydon't 🐍
  89. Problem #027 - pile of coconuts 🥥
  90. Pydon't disrespect the Zen of Python 🐍

2020 21

  1. Problem #026 - counting squares
  2. Problem #025 - knight's tour
  3. Pydon't Manifesto 🐍
  4. Problem #024 - hats in a line
  5. Filling your Pokédex - a probabilistic outlook
  6. Implementing an interpreter in 14 lines of Python.
  7. Problem #023 - guess the polynomial
  8. Twitter proof: consecutive integers are coprime
  9. Twitter proof: maximising the product with a fixed sum
  10. Problem #022 - coprimes in the crowd
  11. Problem #021 - predicting coin tosses
  12. Let's build a simple interpreter for APL - part 3 - the array model
  13. My two cents on the 2020 APL competition
  14. Twitter proof: size of the set of subsets of a set
  15. YAMLUtils: automating boring stuff with Python
  16. Studying the "24 Game"
  17. Problem #020 - make 24 with 3 3 8 8
  18. Let's build a simple interpreter for APL - part 2
  19. Problem #019 - fold the alphabet
  20. Problem #018 - circle of hats
  21. Let's build a simple interpreter for APL - part 1

2019 8

  1. Verifying tautologies with Haskell
  2. Problem #017 – shuffle me around
  3. Problem #016 – hamburger dilemma
  4. The formula that plots itself
  5. Mathy broccoli
  6. Problem #015 – cover me not
  7. Problem #014 – the sum of the parts
  8. Problem #013 – circular train

2018 10

  1. Problem #011 – salvation of the monks
  2. Problem #012 – it is just a matter of time
  3. The birthday bet
  4. Problem #010 – Alice and the Maths Hatter
  5. Problem #009 – greedy pirates
  6. Problem #008 – cutting squares
  7. Problem #007 - binary multiples
  8. Problem #006 - stacks of beans
  9. The CCC of proof methods
  10. Problem #005 - number me right

2017 19

  1. Solving mazes with programming
  2. HueHue: a colourful game
  3. Problem #004 - solvability of the water buckets
  4. Water buckets riddle
  5. Finding all strings a regular expression can find
  6. Twitter proof: irrational rationality
  7. Problem #003 - a quarrel in the Shire
  8. Problem #002 - a bag full of numbers
  9. Problem #001 - a dancing triangle
  10. Solving diophantine equations with random walks
  11. Random walk simulations in 2D
  12. Egyptian multiplication with Haskell
  13. Fractals and the filled Julia set
  14. On recursive functions and Kleene's approach
  15. Creating a programming language from scratch
  16. Fractals and the Mandelbrot set
  17. Pigeon Pooping Simulator
  18. Minesweeper remake
  19. A gradient descent algorithm to optimally distribute points over a sphere