Here's my problem: I want 2 single objects to reference and update one another's attributes.
So, I tried doing this (I'm building chess):
# white.py
class White(object):
...
def move_white_piece(self):
from black import Black
black_object = Black()
# ...
The reason I'm importing inside the function is that without doing it, a circular dependency occurs (i.e White does not know about Black yet since White was declared first). This fixes the AttributeError (the class is now defined). However, this brings up a new issue where now I'm using a new object (therefore not current attributes) inside the function every time. I need to use a single object throughout my entire program. Is this possible?
I have never had this problem in C++ because of forward declarations and prototypes.