StingrayReader Upgrade
some_data = {name: source[name] for name in the_names} the_object = SomeClass(**some_data)
some_data = {name: source[name] for name in the_names} the_object = SomeClass(**some_data)
For the last week I've been working with some legacy code that reveals a kind of problem I hadn't really seen before.
I'm calling it the Wrong Abstraction.
I want to contrast this with the Leaky Abstraction, where implementation details are revealed and raise havoc.
The Wrong Abstraction problem seems …
more ...See "Additional, Related Content". It's one of the posts here: https://www.patreon.com/slott.
I think there's space for a Building Skills in Functional Python title next to the Building Skills in OO Design.
more ...See https://github.com/slott56/cpx-xmas-ornament You'll need a Circuit Playground Express https://www.adafruit.com/product/3333 Install the code. Enjoy the noise and blinky lights. The MML translation isn't as complete as you might like. The upper/lower case for the various commands isn't handled quite as cleanly …
more ...>>> t_s = (8063599, 0) >>> fields = [(t_s := divmod(t_s[0], b))[1] for b in (60, 60, 24, 7)] >>> list(reversed(fields + [t_s[0]])) [13, 2, 7, 53, 19]
I've recorded two courses for LinkedIn Learning https://www.linkedin.com/learning/me
Let me emphasize that their production values take a lot of work. While I think I'm a pretty good live presenter, a few days in the recording booth with a producer, reveals all my weaknesses. so. um …
more ...Here's a functional programming design pattern I uncovered. This may not be news to you, but it was a surprise to me. It cropped up when looking at something that needs parallelization to reduced the elapsed run time.
Consider this data collection process.
for h in some_high_level_collection(arg1): for l …more ...
This can be an interesting exercise. I think it is something that can help people learn to code well. I found this in the LinkedIn Python community: https://www.linkedin.com/groups/25827/.
The Palindrome Problem:
more ...Make a function that makes a palindrome out of the letters in a string …
Follow my Patreon: Become a Patron! I'll try to focus on my Building Skills in OO Design book there. I'm thinking of adding some more code examples. Is that a good idea? Maybe that should be the higher-level Patreon benefit?
more ...Tweet:
Real Python(@realpython)
📺🐍 Cool New Features in Python 3.8 realpython.com/courses/cool-n…
The Cool New Features in Python 3.8 lists some of the things that could become part of The Modern Python Cookbook 2e. I'm working with Packt on a plan …
more ...