[Baypiggies] Baypiggies snippets

Keith Dart ♂ keith at dartworks.biz
Thu Mar 29 04:41:32 CEST 2007


Doug Landauer wrote the following on 2007-03-21 at 23:07 PDT:
===
> If we have come across the need/desire for a new general method that
> should work just fine with anything that "quacks like a sequence", and
> we would like to make it available to any sequence in any of our Python
> code, and I want to invoke it as foo.method for any foo that is
> a sequence, then where/how would I define such a method?
===

Ok, so now I also have a better idea of what the answer to this
question is. The consensus is: anywhere you want, as long as you
explicitly import it. 

I suppose the most acceptable pattern is something like this:

from mypackage import utils

utils.waddle(quacker)

What say you?



-- 
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Keith Dart <keith at dartworks.biz>
   public key: ID: 19017044
   <http://www.dartworks.biz/>
   =====================================================================



More information about the Baypiggies mailing list