[docs] [issue21763] Clarify requirements for file-like objects

Nick Coghlan report at bugs.python.org
Sun Jun 15 23:49:11 CEST 2014


Nick Coghlan added the comment:

Asking the question "Does it quack and walk *enough* like a duck for my
code to work and my tests to pass?" is part of the nature of ducktyping.

ABCs are definitely a useful guide to expectations, but even there it's
possible to lie to the interpreter and have "required" methods that raise
NotImplementedError, or do an explicit registration without implementing
the full interface.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21763>
_______________________________________


More information about the docs mailing list