[Python-Dev] [issue3214] Suggest change to glossary explanation: "Duck Typing"

Steve Holden steve at holdenweb.com
Wed Jul 2 13:23:48 CEST 2008

Paddy 3118 wrote:
> Hi,
> I'd like extra opinions on this issue please:
>  http://bugs.python.org/issue3214
> It's about changing the definition of Duck typing to remove hasattr and
> leave just EAFP in the enablers - more detail is in the issue log.
The change seems to make sense. Use of hasattr() to determine method 
availability, while not strictly "look before you leap" because it 
doesn't test for a specific type, certainly isn't EAFP either.

Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

More information about the Python-Dev mailing list