The second edition of my book was just published and available at the source and on Amazon. To purchase, just click one of the links in the sidebar!
Also, I’ll be writing up a new article to be published on here this weekend, so look forward to that!
I was looking through some of my old posts, and started reading one that I wrote for Java, and I just didn’t like it. So, I’ve decided to go through and rewrite a bunch of the old posts (I’ll keep the old ones as they are), updating them to Kotlin. In some, I may even put the old Java code in just to show how much nicer Kotlin makes it.
I’ll try to get the Java/Kotlin version of the DocRaptor article written soon. Also, I’m in talks with another website to write paid posts for their blog. If I get to, I’ll share links to the articles I post there.
I’m also in talks with Apress to write a second edition of my book, Python Descriptors. Changes will mostly be adding content on the
__set_name__() method added to the descriptor protocol in 3.6 as well as a full chapter on my instance–level properties idea. Other than that, I’ll be going through and just cleaning up the writing in general if I spot anything. I’ll probably also simplify the flow charts. At the same time, I’ll be putting together a talk on Python Descriptors that I hope to give at That Conference this year.
Overall, I’m feeling the push to get back to writing. Hopefully, I can keep up with it.
Last week, I showed you my new implementation for instance-level properties in Python. This week, we’ll take another look at it by implementing a few Delegated Properties and helpers to make using them just a hair nicer.
Recreating Kotlin’s Built-In Delegates
For inspiration of what Delegated Properties to create, we’ll start by recreating the ones built into Kotlin, starting with
Lazy. Continue Reading
A while back, I did a post on making instance-level properties in Python where the implementation of it required inheritance as well as messing with
__setattr__(), which are a little dangerous to mess with. Then I had another idea last night (as of the time of writing this): Use normal descriptors to delegate to “Delegated Properties” (name taken from Kotlin, the original inspiration). These Delegated Properties can be designed very simply in a way that they only have to worry about the value on one instance, instead of figuring out how to store the value per instance. 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
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@example.com 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!
So here’s my attempt at accomplishing the closest thing possible toward making object literals in Python. Continue Reading