by NooneAtAll5 · 2w ago · 0 comments
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++
Python isn't immune from those either by the way (e.g. walrus operator, pattern matching) but nowhere near C++ level.
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
do you still enjoy speaking english?