
On Dec 2, 2013 6:12 PM, "Oleg Broytman" <phd@phdru.name> wrote:
Hi!
On Mon, Dec 02, 2013 at 04:55:22PM +0100, Gregory Salvan <apieum@gmail.com>
wrote:
For now I've basically called it isducktype(X, A) it returns true if: - X has all attributes of A
Isn't the requirement too strong? When I need a file-like object I seldom need more than .read() and .write() methods, and even of those I seldom need both at once -- I usually need one or the other. Testing for strict conformance is not duck typing IMO -- it's interface. Interfaces are for nominal languages. Technically it should be called x.is_structurally_subtype()
Elazar _______________________________________________
Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas