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 ethan.furman
Recipients Jim.Jewett, Joshua.Chin, ethan.furman, pitrou, r.david.murray, rhettinger
Date 2014-11-05.16:04:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Raymond declared:
> Let's be clear.  These are duck-typed methods.  A type check is inappropriate.
> Anything with o.items() is allowed regardless of type.

Wikipedia explains (
> In computer programming with object-oriented programming languages, duck typing
> is an alternative to typing. In duck typing, an object's suitability for some
> purpose is determined by the presence of certain methods and properties [...]

I did use an actual 'type' check in one of my exmaples, and that was wrong.

It is possible to do a "duck-type check" with a `hasattr(other, 'items')`.

I don't use Counter myself -- I'll try and find some real-world examples.
Date User Action Args
2014-11-05 16:04:33ethan.furmansetrecipients: + ethan.furman, rhettinger, pitrou, r.david.murray, Jim.Jewett, Joshua.Chin
2014-11-05 16:04:33ethan.furmansetmessageid: <>
2014-11-05 16:04:33ethan.furmanlinkissue22766 messages
2014-11-05 16:04:33ethan.furmancreate