Multimethods

Paul Prescod paul at prescod.net
Sun Jul 23 11:50:24 EDT 2000


Neel Krishnaswami wrote:
> 
> I don't understand you here.
> 
> The way I understand method dispatch in Python to work is as follows.
> If a name lookup that searches a class finds a function, that function
> is wrapped in method clothing and returned. Assigning a function to an
> instance slot will simply put a function in the slot.

Right. My point is that when Python sees the syntax

foo.bar()

It looks at __dict__ and then __bases__.__dict__ . You seem to want it
to look somewhere else but a) where and b) with what efficiency?

And which takes precedence?

-- 
 Paul Prescod - Not encumbered by corporate consensus
New from Computer Associates: "Software that can 'think', sold by 
marketers who choose not to."




More information about the Python-list mailing list