Mark Dickinson added the comment: I'm fairly sure that this behaviour is deliberate, and (more-or-less) consistently applied throughout the builtin and standard library types. If you create a subclass C of list, then concatenation of two instances of C still gives a result of type list. Similarly, if you subclass Decimal then arithmetic operations on instances of your subclass still return a Decimal instance. If you want operations to return instances of the subclass, it's up to you to override those operations in your subclass.
Having the Counter operations automatically return an instance of the subclass would mean placing restrictions on the signature of the constructor of any such subclass, which may be undesirable. (A subclass may want to require additional arguments in its constructor.) ---------- nosy: +mark.dickinson _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25535> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com