6 ms·
No, that is not the recommendation. People routinely and reliably inherit from dict. The UserDict class is mostly defunct and is only still in the standard li
by mont_tag 1y ago
No, that is not the recommendation. People routinely and reliably inherit from dict.
The UserDict class is mostly defunct and is only still in the standard library because there were a few existing uses that were hard to replace (such as avoiding base class conflicts in multiple inheritance).
- smcin 1y agoUserDict is not formally deprecated but it will be someday, so code that relies on it is not future-proof.
- 9dev 1y agoAh, Python. The language where nobody agrees on the right way to do things, ans just does their own instead. Five ways to describe an object of a certain shape? Six package managers, with incompatible but overlapping ways to publish packages, but half of them without a simple way to update dependencies? Asynchronous versions of everything? Metaprogramming that makes Ruby blush? Yes! All of it! Lovely.