Linsomniac's Articles
  • Entries
  • About
  • Tags
Linsomniac's Articles

Python


Docker Apt Install for Python+UV

A Proposal for Hynek's Docker Recipe

   |  Sean Reifschneider

While reviewing Hynek’s awesome “Production-ready Python Docker Containers with uv” article, I made some changes to the final container. Here’s my proposal for changes.

[Read More]
Python  Docker  uv 

Deep nesting vs Magic

Which of these two code chunks is better

   |  Sean Reifschneider

I had a piece of code that was deeply nested for loops, and I wanted to see what it could look like if it wasn’t deeply nested. Deep nesting is the root of all evil, you know. Which is the most clear, maintainable code?

[Read More]
Python  Refactoring 

Python Testing a CLI Script Without .py

How to import a module without .py suffix

   |  Sean Reifschneider

I often write little CLI programs in Python, where I just want to call it “script” rather than “script.py”. I also want to be able to test functions in these scripts. It gets tricky if you want to test code from a file without a “.py” suffix.

[Read More]
Python  Testing 

Sean Reifschneider  • © 2025  •  Linsomniac's Articles

Hugo v0.110.0 powered  •  Theme Beautiful Hugo adapted from Beautiful Jekyll