[Python-3000] Discussions with no PEPs

Nick Coghlan ncoghlan at gmail.com
Tue Mar 13 15:12:26 CET 2007


Barry Warsaw wrote:
> Two other things I wanted to mention.  One, I do think adaptation is  
> an important (necessary?) aspect to any interface solution for  
> exactly the reasons you state.  Second, I think the other thing that  
> bugs me about a pure-generics solution is that all the generic  
> functions seem to want to live in a global namespace.  That's fine  
> for len() or iter() or keys(), but not so good for  
> all_nonbouncing_regular_delivery_members().   In that sense, for more  
> domain-specific functionality, it just seems that interfaces (w/ 
> adaptation for that extra level of abstraction) is the object- 
> oriented approach to generics.

Generics can live quite happily inside modules and as methods on objects.

The important aspect is the ability to tell the generic function "here's 
how to frobnicate a doodad", even though the basic frobnicator knows 
nothing about doodads, and doodads know nothing about frobnicating. That 
machinery can be designed to work for any callable.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list