On 10/18/05, Daniel Schierbeck <daniel.schierbeck / gmail.com> wrote:
> Tell me if this is stupid. I'm sure there's a simpler and faster way
> to do this, but I'm interested in knowing whether the idea itself
> is... well, stupid.

[...]

> Basically, when I call obj.quacks_like? Klass I ask if every public
> method defined in Klass is defined in obj as well.

I don't think it's what you want. I won't call it stupid, but note that
StringIO can be used as an IO for most things -- but not all things. In
general, the duck typing philosophy seems to be "does it quack this way
at this time" -- being concerned only about a single method at a time.

-austin
--
Austin Ziegler * halostatue / gmail.com
               * Alternate: austin / halostatue.ca