Relative import problems in Python 3

后端 未结 7 1024
庸人自扰
庸人自扰 2021-02-13 21:01

Python imports drive me crazy (my experience with python imports sometime doesn\'t correspond at all to idiom \'Explicit is better than implicit\' :( ):

[app]
           


        
7条回答
  •  猫巷女王i
    2021-02-13 21:40

    A better solution for your problem is to put package1 in it's own separate package. Of course then it can't import package2, but then again if it is reusable, why would it?

提交回复
热议问题