3 ms·
It probably wasn't a good idea to start it out is showing string constants aren't optimized. If they wanted to talk about really unintuitive reference gotchas i
by msgodel 1y ago
It probably wasn't a good idea to start it out is showing string constants aren't optimized. If they wanted to talk about really unintuitive reference gotchas initialization in optional function parameters would have been a way better example.
- harrisi 1y agoI appreciate the sentiment, but even this is a good example of why this stuff is interesting. Because some strings _are_ optimized (using some definition of "optimized"), but only in some cases. It's these quirky little things where the code doesn't exactly represent the way execution happens in most straightforward mental models of how execution works. Again, it's not bad and it's not unique to Python. It's just the nitty gritty of how some things work. I will say that calling it "What The Fuck Python" is certainly more attention-grabbing than "Some Interesting Bits About Python Internals You Probably Don't Need To Know". What're you gonna do. :)
- msgodel 1y agoI don't know I think "Python doesn't optimize <x>" is one of the least surprising classes of statements in programming.