CodeSolid Python Newsletter: December 28, 2022
Happy Holidays from CodeSolid!
I hope your holiday season is filled with all the good stuff – being with family and friends, and staying warm – and none of the bad stuff, like Seasonal Affective Disorder or being stuck in a snowbank.
As usual, we’ll share a quick roundup of what’s new on CodeSolid and some goodies we found elsewhere on the interwebs.
New and Featured on CodeSolid
Understanding Python Types and Type Hints
When considering types in Python, two things come to mind for me. The first thing is the Python type system’s excellent support for exploring and learning about your code interactively (using type, dir, and help). The second thing that comes to mind is the type hint system, formally supported in Python 3.5 (though some of its syntax works in earlier Python versions as well). In this article, I treat both these features, which are favorites of mine.
Python Functions (Series)
I’ve written a few longer posts about Python functions, but I wasn’t happy with how many readers found them. It turns out that the difficulty when writing about Python functions is not that there’s nothing to write about – it’s that there’s too much to write about! Because of this, the central problem is how to organize it all. With this in mind, I am putting together a series of short articles on various function topics, partly by breaking up some existing articles, and partly by creating new, short pieces.
Python Chemistry
Guest author and retired chemist, Tim Hockswender, has provided us with this interesting look at how to use SymPy and ChemPy for chemistry. ChemPy is a specialized tool for chemistry, but our readers may remember SymPy from our earlier, introductory SymPy article. This is one of those topics I would never have been able to do on my own, so it was great having Tim pitch in on it.
Python Dunder Methods: The Ugliest Awesome Sauce
I was honored this week to have this article featured in PyCoders’ yearly roundup of the year’s most popular articles. It’s always a treat for me when PyCoders or Twitter’s PythonHub take an interest in my work, so being a top article this year is like a special holiday treat.
Python Around the Web
Top Python Libraries of 2022
Speaking of yearly roundups, this list of top Python libraries has been published regularly over the last few years. I found several interesting tidbits on this year’s list.
Nuitka - Python Compiler, New Release
One of the questions I see from Python newcomers is compiling their applications. Though technically speaking Python’s interpreter has a “compiler” step, it doesn’t produce a standalone executable as we’d expect from a language like C or Rust. Nuitka is an optimizing compiler that produces standalone executables from Python files.
Jupyter Scheduler
OK, I have to admit – even as a big fan of Jupyter notebooks, I’ve never thought of them in terms of something I’d like to schedule to run regularly as a job. Nevertheless, now that I’ve seen that I can, I think it’s pretty cool and worth trying out!
Comprehensive Python Cheatsheet
I’m not usually a big fan of cheat sheets, since the combination of Python’s built-in code exploration tools and the official docs are usually my go-to resources for looking things up. Nevertheless, I saw this cheat sheet had a lot of attention on the Python Reddit channel, so I took a look. Sure enough, I was impressed with the sheer scope of this cheat sheet.
Clean Code in Python
Lawrence Eagles has written this excellent, concise article on how to improve your Python code. This article was also featured in PyCoders as a best of 2022.