Right, heres the piece of code:
Now, the output from this is:
{'r': <__main__.Circu it instance at 0x04AD2E90>}
{'r': <__main__.Circu it instance at 0x04AD2E90>}
{'r': <__main__.Circu it instance at 0x04AD2E90>}
but this isn't what I'm expecting, or what I want. TO put it best, I want the behavoius that matches this output:
{'r': <__main__.Circu it instance at 0x04AD2E90>}
{}
{}
Can anyone explain to me what's goig on here, and how I can get the behaviour I want?
Code:
class Circuit:
pass
class Workspace:
Circuits = {}
Components = {}
WORKSPACES = {}
WORKSPACES["a"] = Workspace()
WORKSPACES["b"] = Workspace()
WORKSPACES["c"] = Workspace()
#WORKSPACES["a"].Circuits["r"] = Circuit()
print WORKSPACES["a"].Circuits
print WORKSPACES["b"].Circuits
print WORKSPACES["c"].Circuits
{'r': <__main__.Circu it instance at 0x04AD2E90>}
{'r': <__main__.Circu it instance at 0x04AD2E90>}
{'r': <__main__.Circu it instance at 0x04AD2E90>}
but this isn't what I'm expecting, or what I want. TO put it best, I want the behavoius that matches this output:
{'r': <__main__.Circu it instance at 0x04AD2E90>}
{}
{}
Can anyone explain to me what's goig on here, and how I can get the behaviour I want?
Comment