Kotlin doesn’t have true pattern matching, and that’s fine. In order to make matchable classes in Scala, there is an awful lot of overhead required to make it work, and I highly respect Kotlin’s goal of not adding much overhead anywhere. But that doesn’t mean we can’t try to make our own way to get something closer to pattern matching. Continue Reading
Making Descriptors that act as specialized properties can be tricky, especially when it comes to storing the data the property controls. I should know, I literally wrote the book. Looking at how other languages do it – especially Kotlin’s Delegated Properties – I felt that Python could use a system that works more like that. Continue Reading
I’ve gotten rid of the Book of the Week section on the right sidebar. I’ve only gotten a few clicks, and haven’t gotten any purchases through it, so it doesn’t make sense to continue. If I can build up a stronger following in the future, I may try to bring it back again, but the extra work of changing it every week isn’t worth it at this point.
I have a feeling that the lack of a mobile site that uses the sidebar is the biggest reason that it hasn’t turned out so well. I plan to fix this in the future, but at this point, I really like the non-mobile look and I don’t want to change it, but I’ll probably have to.
Last time, I talked about Python’s boolean operators
or and what can be confusing about them when “truthy” objects get into the mix. If you haven’t already read it, I would highly recommend it. This article is similar, but looks into something just a little different: the ability to string comparison operators.
The Confusing Code
Just like last time, we’ll start off looking at some code that confused someone enough to ask the community about it:
'a' in 'abc' # True True == True # True 'a' in 'abc' == True # False
At a cursory glance, there seems to be something wrong with that it would come up with such a result. Continue Reading
To start, I’ll give an update on my video series. I’ve recorded my first episode, but I’ve had a ton of troubles when trying to edit it. The application keeps crashing, which is okay, since it recovers most of what I did, but it does grow tedious. I’ve also decided to start the editing over due to a few factors. Lastly, I’ve started recording a series of videos with my best friend for his gaming YouTube channel. All of that together has led me to put off the my video series for a while and get back to writing on the blog. I’ll get back to the video series when I’ve finished recording with my friend. It could take a while.
Python Boolean Operator Confusion
A while back, I stumbled upon a post asking about the how the following lines could possibly right:
'a' == 'b' or 'a' returns
'a' == 'a' and 'b' returns
He had a few other lines that did what you might expect, returning
False. But why do these
or operators not always return boolean values? To answer that, I’d like to dig into Python’s history. Continue Reading
I know I said I wouldn’t put up a post until I got the videos done, but this has been nagging at me. As for an update on the videos, I’ve been partially lazy, partially busy, but I’m ready to record the first episode the first chance I get, and I don’t expect to need a lot of editing. Anyway, on with the topic of the day.
The Takipi Blog has recently posted two articles about the top 10 most thrown exceptions (that are logged). These 10 exceptions account for 97% of the exceptions in those logs. I’d like to list off these exceptions in order from most common to least and give a short commentary about them being in the list. Continue Reading
Amir Taboul is the winner of my book giveaway! Congrats, Amir!