Python runtime type checking

Similarly to my python colors that you can just copy and use, my arsenal of do it yourselfs has grown by a typechecking function wrapper. I'd normally say it's not necessary, since if you're serious and using python specifically, static type checking should be enough, but I've recently had to do it without external libraries in many places, and repeating myself many times sounded too annoying. If you ever find yourself in such a place too, here's the code (requires python >= 3.8): ...

April 19, 2026 · 1 min · Nevalicjus

Python Colors

Even though I don't like C's do everything yourself, I love to reinvent the wheel for minor things. This snippet I put here for myself, but you're encouraged to use it. The loop below the class is to make Colors's be at the same time non-instantiated and have all the colors dynamically assigned from the dictionary. Colors.color-lowercase are methods for wrapping a string as color + string + reset, and Colors.color-uppercase are corresponding color codes as strings. ...

January 22, 2025 · 1 min · Nevalicjus