3 ms·
Why are there so many negative comments? Maybe those posters are vastly underestimating how many people that just start out read HN. I think it's a pretty good
by kriro 13y ago
Why are there so many negative comments? Maybe those posters are vastly underestimating how many people that just start out read HN. I think it's a pretty good post to read after something like "X in Y minutes - Python" to get a very quick grasp of what the language is like.
I'm also not ashamed to say that despite having written quite a few LOC of Python I wasn't aware of named slices for some reason and I think they can clear up some chunks of code I have produced (make it more readable)
- Estragon 13y agoI've been using python since the 90s, and I learned a few things from this post.
- shiven 13y agoRight after this string of replies, I was expecting Guido van Rossum would be next, saying he created Python and even he learnt something new...
- k3oni 13y agoSame here, learned something new today.
- maxerickson 13y agoA common theme running through named tuples, itertools and collections is Raymond Hettinger. He has also put together lots of tutorials and talks.
- kriro 13y agoGreat suggestion. Just searched for him on youtube and a couple of excellent looking talks popped up. Halfway through and this one seems great so far: https://www.youtube.com/watch?v=OSGv2VnC0go https://www.youtube.com/watch?v=OSGv2VnC0go Really enjoy his style as well :)
- k3oni 13y agoThank you sir, something else to go through on a quiet Sunday :).
- Bocker 13y agoI've been programming in Python for about 3 years and learned a couple of tricks from this post, which was why I submitted it. There's always tricks to learn, and it's hard to remember everything when you're first starting out with a new language.
- to3m 13y agoExtended unpacking was a new one on me. Kind of like a simple version of pattern matching. I think this one will prove useful! (I've been using python for many years, but not full time. It's the language I use for one-off scripts, small tools that make use of its handy standard library, or prototypes for things I'm going to write in some other language. That's my excuse for the gaps in my knowledge.)
- ggchappell 13y ago> ... I wasn't aware of named slices for some reason .... I wasn't either. But I wouldn't call them a hidden feature of the language. A slice object is an object. So you can make it the value of a named variable, just like any other object. Somehow that wasn't obvious, though. Now I'm wondering how else I might be able to improve my code by giving names to non-obvious things.