Recent submissions

Comment · 4 years ago
Comment · 5 years ago
It would be great if the BANNED() macro could suggest the correct function to use.
Comment · 5 years ago
I wish I never threw out my amber Hercules monitor...
Comment · 6 years ago
Tuples are immutable, but that doesn't mean they can't contain references to mutable objects.

When you want to use a tuple as a key in a dictionary, Python checks if all members of the tuple are immutable. If one or more of them aren't, you'll get an 'unhashable type' error.

Comment · 6 years ago
A while ago, I was also sceptical about the walrus operator, although I use assignments in expressions all the time in C++. But when I was perusing a library written Python the other day, I found five spots in which the walrus operator would make sense - eliminating one line of source code without readability suffering from it.
Comment · 6 years ago
When you write in a language which uses curly braces for statement grouping, do you indent your code? ...? I thought so.
Comment · 6 years ago
Of course you can. The first element of that tuple is a list, which is mutable, and can be sorted in-place.
Comment · 7 years ago
Comment · 7 years ago
Normal-sized HDMI connectors would be great, too.
Comment · 7 years ago
Those small SMD resistors come on a reel, and they're typically much cheaper than 2 cent: more like 0.1 cent. Still, that's $1000 for one million units.
Comment · 7 years ago
Have you tried Cython already? That's almost Python and much faster.
Comment · 8 years ago
Remember QBASIC.EXE, too?
Comment · 10 years ago
He makes 30 microscopic pictures of a beetle, pastes them together, prints it on huge panels (for a museum exhibition). But you can also view them on the website, including at high zoom levels.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton