If you want to access B when you defineA, you need to move it above A in the file.
If you want to access B when you call methods inA, you don't need to do anything: by the time you call a method of A, the interpreter has executed all the definitions.