Recent Articles
2022 11 10 Python 3.11 Error Reporting
Went to a Python meetup today where the new features in Python 3.11 were discussed. Among them was of course the new nifty error reporting. It was noted that the error reporting does NOT work when using the REPL, but only when running a script through the interpreter.
It wasn’t immediately apparent why that was, so I wanted to do a little bit of digging and see if I could find anything about it.
read more
Shebang issue - Ubuntu does not link 'python' to 'python3' by default
I typically use #!/usr/bin/env python as my shebang for Python stuff. I switched to Ubuntu (22.04) from Fedora (36) recently and found that when I tried to run something outside of a virtualenv it bombed out thusly:
/usr/bin/env: ‘python’: No such file or directory This stackoverflow post offered two solutions:
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo apt install python-is-python3
The post that presented the latter pointed me at the package’s description:
read more
Python Decorators
On the subject of Decorators. Right now my brain is feeling overwhelmed and I wonder if I bit off more than I could chew. Not sure exactly which is best to start with but I’ll first go for the how and follow up with some of the why.
Also this article assumes some knowledge of decorators already. It’s not intended to be a full course on how they work or the motivation behind them (though I attempt to shed light on both).
read more