Hacker News new | ask | show | jobs
by NooneAtAll5 22 days ago
I still don't understand the "feature creep" complaint

python just introduced built-in sentinel, and only comment on an explainer video brought up that it's nothing new and is just a rename of unittest.mock.sentinel

who even knew there's unittest module? who even knew there's unittest.mock? definitely not me

because it doesn't matter - you use what you need and learn what you encounter. Same thing with C++

3 comments

There's a big difference between a function or class that you didn't know about (or has just been added to the standard library) vs a new language feature.

Python isn't immune from those either by the way (e.g. walrus operator, pattern matching) but nowhere near C++ level.

While I agree that the Python standard library contains a lot of stuff, I am surprised that you have never heard of the unittest module. Sure, pytest is a very popular replacement, but its documentation frequently refers back to unittest, and the unittest module is also one of the top hits if you search for "python testing".

It has also been in there since Python 2.1, as far as I can tell [1], though the mock module is somewhat newer [2], but still quite old at this point. In all that time, have you never skimmed through the list of modules in the standard library? I'd recommend doing so once in a while, since a lot of the stuff in there is quite useful: https://docs.python.org/3/library/

[1] https://docs.python.org/2/library/unittest.html [2] https://docs.python.org/3/library/unittest.mock.html

also "do you still enjoy X" is a loaded question

do you still enjoy speaking english?