[Edu-sig] re: Naming in Python

ajsiegel at optonline.net ajsiegel at optonline.net
Sat Jan 29 20:55:36 CET 2005



----- Original Message -----
From: Rodrigo Dias Arruda Senra <rsenra at acm.org>
Date: Saturday, January 29, 2005 2:11 pm
Subject: Re: [Edu-sig] re: Naming in Python
 
> Perhaps this is a duck typing style of defining what
> an object *is*.  

Interesting that the discussion here led to duck typing, because
I was about to use the term myself to explain myself re: naming
more generally.

Python is happy to oblige us with

for thing in things:
    thing.quack()

as long as the things all have a method named "quack", and not
caring what each thing is and what quack does in context for 
any particular thing.

...this being one way in which what I name something is to the essence
of my code and why I am inclined to pay attention to names. And while
I'm paying attention to names in this way anyway, I am inclined to be 
sensible in choosing them.

Not pinned down, but something along these lines is my point.

Happens, BTW, that I was accused on python list of not understanding Python
because I don't understand duck typing.

My response was something to the effect that it is easier for me  to 
understand how Python works, and if that is called duck typing, I'm OK with that.

Trying to understand what duck typing is, as a means to understanding how
Python works, is - at least in terms of how my mind works - the wrong way
around.

Art 

.






  



More information about the Edu-sig mailing list