News for hackers. Stuff that matters.
Re:Things to use in Python 3 by baseballMan on Wednesday May 15, 2019 @12:11AM (#19916356)
I'm by no means a hardcore python dev but I feel like these are all pretty basic, common things. No?
Re:Things to use in Python 3 by jedberg on Wednesday May 15, 2019 @12:37AM (#19916452)
They're basic but also things you'd never look up, especially if you've been doing python a long time.

For example, I just learned about f strings, because why would I need to ever look up if there is a replacement for .format()?

And the LRU cache. I've been hand rolling that for years, but I never thought to see if they had added it to the standard library, because why would I look?

Re:Things to use in Python 3 by mixmastamyk on Wednesday May 15, 2019 @01:21AM (#19916629)
It pays to look thru the stdlib every so often, there is just so much there, and plenty of dark corners (in the Warcraft sense) to look in.

I hand rolled stuff in itertools/functools for years before discovering them.... collections Counter, etc.

Or how about str.partition instead of try: str.split() ?

Re:Things to use in Python 3 by Twirrim on Wednesday May 15, 2019 @01:45AM (#19916742)
On a related note, every couple of years I make an effort to man page every cli tool I use, and re-read the man page, just in case. Most times I discover there is some argument that I've missed before in a tool (or has been added in the intervening time)
Re:Things to use in Python 3 by jedberg on Wednesday May 15, 2019 @04:23AM (#19917388)
When my dad sold cars he’d always tell his customers to read the car manual again after six months for the same reason.
Re:Things to use in Python 3 by stOneskull on Wednesday May 15, 2019 @04:10PM (#19923221)
don't you read about what's new when new versions come out?
Re:Things to use in Python 3 by dagw on Wednesday May 15, 2019 @02:33AM (#19916918)
I've been programming python, on and off, since 2001, and I still learnt a couple of things.
Re:Things to use in Python 3 by nerdbaggy on Wednesday May 15, 2019 @12:19AM (#19916388)
I don’t think an LRU cache is basic
Re:Things to use in Python 3 by jakear on Wednesday May 15, 2019 @12:29AM (#19916417)
If you’ve ever needed it, and I imagine most people have, it shows up on any web search.

That being said I usually end up rolling my own that can serialize complex objects.

Re:Things to use in Python 3 by dagw on Wednesday May 15, 2019 @03:59AM (#19917265)
If you’ve ever needed it, and I imagine most people have, it shows up on any web search.

It didn't last time I googled it (because it didn't exist then), so I had no idea it existed.