I have following structure for my program-
File1.py
class A:
index1
def method1():
// --do stuff--
File2.py
import File1
Class B:
index2
def method2(a) // Needs Object of A as a parameter
// --do stuff--
a.method1() // How can I guarantee that this is an object of class A
File3.py
import File1
import File2
Class Starter:
def start():
a = A()
b = B()
b.method2(a)
I have few questions-
- How can I ensure that parameter a in method2 is an object of class A?
- It might be IDE specific, but can I find out all the methods and variables that I can access in method2 on object 'a' while writing the code?
- Is it better to write such object oriented programs in Java rather than python?