There would be two ways to implement that, neither of which are particularly good. You could either have the exit function call itself from its __repr__ method, which an abstraction violation so egregious it introduces security vulnerabilities (imagine a logger printing repr(thing) to stderr, and someone sneaking the exit function in there for it to print), or you could special case it by making exit a reserved word, which flies in the face of the Python 3 ethos which changed print from a reserved word to a function and breaks a lot of established code.
Programming languages have rules that the programmer is expected to learn. Part of being a programmer is foregoing a certain amount of user friendliness in favor of an environment that is more powerful so that we can actually get things done. Programmers are paid to memorize and follow these rules so that the end user does not have to learn them.
You're trying to think of problems, not solutions.
It's pretty easy to think of a good solution with few enough downsides that overall the design is much better:
In the REPL only, if you type "exit" and press enter, it quits.
No changes to Python semantics required. All code still works. Much friendlier UX.
I wonder what dubious justification the Python Devs would come up with to avoid implementing that (and therefore admitting they've been wrong for 20 years). They'd probably try and claim it is more confusing to beginners or some nonsense like that.
I’ve got a shitty laserjet from HP that’s approaching 20 years old and still working more or less. It doesn’t have WiFi so I’m not sure it’s ever received an update to its closed firmware.
Now, I know nothing about 3D printing, but I fail to see why a 3D printer needs firmware updates to remain functional five years down the road, if it’s working today and the hardware doesn’t break down.
If I understand TFA correctly, I can buy a largely equivalent model with closed firmware at 1/3 the price, or a better one at 1/2 the price. Choosing the closed firmware one would be a no brainer for me. Edit: Rereading the passage, it seems even the 1/3 price model is better.
> Now, I know nothing about 3D printing, but I fail to see why a 3D printer needs firmware updates to remain functional five years down the road, if it’s working today and the hardware doesn’t break down.
Most don't need updates to remain functional, but this is still a very immature and rapidly evolving industry. The quality difference in the last two years is significant and a lot of the advances are in firmware, not just hardware. The difference between old and new firmware could be a higher quality print in half the time.
Consider a DRM system that does challenge/response against said secret so that only one computer at a time can use something. As the owner of this device, if I want to clone it, I should be able to.
But then the device could be used by 2 computers at once defeating the security. Another use case would be as a second factor of authentication. Making it impossible to clone is essential for a "something you own" factor.
Oh my God, where has this program been my entire life? I've been hackily using a Python interpreter to do back of napkin math and trying to keep track of units etc in my head (and making frequent use of the up arrow key when I need to save a result from a previous equation). This program would have been a game changer if I'd discovered it a few months earlier before I finished my university physics course. It probably still will be next semester. I'm sincerely blown away by the automatic unit conversion. Each variable has a unit, and when I divide joules by meters I get newtons. This is fantastic and I cannot believe it is free, much less open source!