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
Hey readers! I finally finished publishing my book, Python Descriptors: A Comprehensive Guide! It is currently available on Lulu, and will eventually be available on Amazon, B&N, and other sites. It comes in both a Digest size paperback or ebook. So, go check it out and buy a copy, if you’d like!
For my followers, I’ll work on getting the deal out soon. Also, if anyone who has a blog, podcast, or other public content and would like to do a review of my book, I’ll get you a free pdf copy of the book to do the review from! Email me at firstname.lastname@example.org and let me know.
I’ll soon get an additional blurb on the site’s sidebar so that it’s easy to find a link to the book.
Today, I give you the second (and last) excerpt from my book, and it’s the last chapter. It brushes over some of the cooler examples of descriptors out there. It’s a short sample, and I feel kind of bad not giving you something juicier, but too much of the rest of the book has references to other chapters and discussed ideas, making it difficult to use as an excerpt. Continue Reading
Last week, I posted that I would put up some excerpts from my book, Python Descriptors: A Comprehensive Guide, this week and next week. This is the first of two.
This chapter of the book has one of my greatest epiphanies in it: “unbound attributes”. For context, I decided to provide the entire chapter here, instead of just putting the excerpt about unbound attributes in. Despite the context, this chapter assumes you at least know the descriptor protocol and its basics. If not, check out Raymond Hettinger’s relatively short article on descriptors. Enjoy! Continue Reading