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
Everyone, come celebrate with me; my last post about how Java 8 Streams work was my 50th post on this blog!
It’s not a huge milestone, but it’s a milestone nonetheless. Thank you to all you readers out there that have followed my blog and given helpful comments. Again, thank you! Also, have a Merry Christmas (or Happy Whichever-Holiday-You-Celebrate)!
When I first laid eyes on Java 8’s Stream API and found out that it worked lazily (then found out what that meant), I was blown away and utterly baffled. It didn’t seem possible at all. Eventually, I was able to wrap my head around it, realizing it was done with my favorite design pattern: the Decorator Pattern!
In this post, I’m going to go through and write up a simplified implementation, only going through the
reduce() methods. We’ll also be ignoring the ability to parallelize the calls. Lastly, for the sake of readability, I’ll be ignoring
extends in the generics. Continue Reading
Hello, dear readers! I’m back from my writing hiatus.
Good news: I’ve got my main draft of my book done, and my editors will be looking at it for the next month. Meanwhile, I’ll be writing for the blog here again! This weekend, I’ll be doing an all-new post on something I’ve had on my mind for a while now. The next couple of posts after that will be sneak peeks at chapters from my book! Then I hope to be back into my regular writing groove again.
I also plan to have a special deal on my book for any followers, so keep your eyes open for that!
I’ll see you guys this Saturday with my next post!