Re: Slave to master auto linking.

2011-11-13 Thread Chris Angelico
2011/11/14 Богун Дмитрий : > m = master() > s = m.slave() > s.master is m > Can you simply have m.slave() pass a parameter to the slave's constructor? class Master(object): class Slave(object): def __init__(self,master): self.master=master print 'Slave.__init__: se

Slave to master auto linking.

2011-11-13 Thread Богун Дмитрий
Hello. I try make some weird thing. I want to get from code like this: class master: ... class slave: ... m = master() s = m.slave() s.master is m Last expression must be true. I want link "master" to be set automatically by master object while creating slave object. Additional