What about something like:

supply = supply()
compressor = compressor(supply)
combuster = combuster(compressor)
compressor.append(combuster)
turbine = turbine(combuster)
combuster.append(turbine)


-Larry Bates


[EMAIL PROTECTED] wrote:
> I have a problem. I'm writing a simulation program with a number of
> mechanical components represented as objects. When I create instances
> of objects, I need to reference (link) each object to the objects
> upstream and downstream of it, i.e.
> 
> supply = supply()
> compressor = compressor(downstream=combustor, upstream=supply)
> combuster = combuster(downstream=turbine, upstream=compressor)
> etc.
> 
> the problem with this is that I reference 'combustor' before is it
> created. If I swap the 2nd and 3rd lines I get the same problem
> (compressor is referenced before creation).
> 
> 
> aargh!!! any ideas on getting around this?
> 
> Dave
> 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to