top | item 44735920

(no title)

mont_tag | 7 months 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).

discuss

order

9dev|7 months ago

Ah, 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.

smcin|7 months ago

UserDict is not formally deprecated but it will be someday, so code that relies on it is not future-proof.