Binding? problem

Josh English english at spiritone.com
Mon Sep 13 12:18:27 EDT 2004


Scott David Daniels wrote:
> Josh English wrote:
> 
>> I'm working on a Stack based language that can import methods from 
>> predefined libraries. Here's what I mean....
>>
> Tell us more about the problem you are trying to solve.  Normally you'd
> do this on classes.  Why doesn't this work?:
> 

What I want to do is have a class method that takes methods from one 
class and applies them to the class instance, overriding the 'self' in 
the method from the Library class to the Runner class. I'm looking for a 
way to do this dynamic importing:

class Library:
	... methods that have 'self' calls

r = Runner()
r.Import(Library)

r should now have the methods in the library.

Josh English




More information about the Python-list mailing list