re: Practical Python - Duck-typing to the rescue! VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Nice hack! But here is some little critique because the title implies a broader use for it. Duct typing is awesome, but some Duck objects are dang...
 

You points are much appreciated, Ali! Thanks!

I do understand that the title is generic while the content only covers a smaller ground. I'm sorry for that. And to be fair, readability is a first-class concern of mine (I have a much over due unpublished article on the matter), thus the context-through-variable-name.

Also, I thought about using the NamedTuple but wasn't sure about the . accessor (and apparently was too lazy to search) which led me to the duck.

code of conduct - report abuse