Re:The Elements of Python Style
by encoderer on Monday January 04, 2016 @10:41PM
(#10840975)
But it's not pythonic to care if something is a "Card" or not. All that matters is if looks and acts like a Card.
[ Parent
| on HN ]
I've never agreed with that. Without a good definition of what exactly it means to "look and act like a Card", large projects can easily get several slightly different definitions of what a Card is like, and nobody knows exactly which methods to use where (so what exactly do I need to implement so my class is a "file-like object"?). Horrible.
I call it smurf typing. If it smurfs like a smurf, smurfs like a smurf and possibly smurfs like a smurf, we consider it a smurf. Good luck with that information.