Я запутался после 25 лет программирования на Python.Почему эта штуковина (сжатая до минимума) печатает «Нет»?Я ожидаю, что объект "thing.implementation1.Juggernaut в 0xblahblahblah".Что здесь происходит?
main.py
import thing
thing.run()
вещь / __ init __. Py
from .implementation1 import init
from .implementation1.main import *
вещь / реализация1 / __ init __. Py
foo = None
class Juggernaut:
pass
def init():
global foo
foo = Juggernaut()
вещь / реализация1 / main.py
from . import init, foo
def run():
init()
print(repr(foo))