This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, r.david.murray, rhettinger, rmalouf
Date 2015-11-02.18:39:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1446489596.12.0.274400890803.issue25535@psf.upfronthosting.co.za>
In-reply-to
Content
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.)
History
Date User Action Args
2015-11-02 18:39:56mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, r.david.murray, rmalouf
2015-11-02 18:39:56mark.dickinsonsetmessageid: <1446489596.12.0.274400890803.issue25535@psf.upfronthosting.co.za>
2015-11-02 18:39:56mark.dickinsonlinkissue25535 messages
2015-11-02 18:39:55mark.dickinsoncreate