by ches · 12y ago · 0 comments
Have to make an explicit cast with a structural type? Surely you can do better, like, say, a trait.
> I'm talking about casting, calling a method that the type system doesn't know is present.
I think a larger example is necessary to see how you ended up in such a situation, but I suppose it's off-topic...
Usually, yes. But the only way that's as general as the Python line is to use the structural type.