0

The collections module has functions like

UserDict
UserList
UserString

which are used to create a custom dictionary or list or string.

One example could be to create a custom dictionary, which does not support item deletion.

But why is there no,

UserSet
UserTuple

???

apostofes
  • 2,959
  • 5
  • 16
  • 31
  • The three types exist for historical reasons back when subclassing of builtins wasn't possible. There is little point having them today, and even less point adding more. – MisterMiyagi Mar 06 '22 at 12:37
  • 1
    Questions of the form "Why does library __________ not implement ____________?" are generally unanswerable by anyone other than the author(s) of the library. People can speculate, but that is somewhat opinion-based. – John Coleman Mar 06 '22 at 12:37

0 Answers0