Python class defined in the same file as another class - how do you get access to the one defined later in the file?

后端 未结 5 1843
迷失自我
迷失自我 2021-01-23 02:06

I\'m very new to Python, I figure this question should be easy to answer.

My problem simplified is this...

I have 2 classes in a File class A and class B. Class

5条回答
  •  独厮守ぢ
    2021-01-23 02:52

    A workaround that comes to my mind is to separate the classes into multiple files, so you could have a python package "models" in which you'll have A.py and B.py. Then you avoid the ordering issue

提交回复
热议问题