I need to preface all of this with a disclaimer:
I love Python, but I am able to see plenty of faults with it. In this article, I attempt to provide a very roundabout way of working around one of those faults: the lack of multi-line lambdas. This is not to say that this is a good solution, but it may be one of the best that we have for certain cases. Try and see if one of the typical workarounds is the best option before settling on this. Continue Reading
Python
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
Last time, I talked about Python’s boolean operators and and 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' == 'a' and 'b' returns 'b'
He had a few other lines that did what you might expect, returning True and False. But why do these and and or operators not always return boolean values? To answer that, I’d like to dig into Python’s history. Continue Reading
So, the original version of my print book ended up having a messed up cover. The color was off and there were strange artifacts all over. I was able to fix this, and the printers sent me a copy to verify that it truly was. Soooo, I now have an extra copy of my book, which I will now be giving away!
I’ll be doing a random drawing for it. To enter, simply send me an email at [email protected] that says something along the lines of “I wanna win!”. The last day to enter is May 25th. On the 26th, I will choose randomly from the emails, then email you back to get the address to send the book to. I will be covering shipping costs, so everything is completely free to you!



