main.py
Код: Выделить всё
import newFile1
class Car:
def __init__(self, speed):
self.speed = speed
car = Car(10)
print("main.py:", id(car))
Код: Выделить всё
from main import car
print("newFile1.py:", id(car))
Код: Выделить всё
main.py: 2095179490752
newFile1.py: 2095179490752
main.py: 2095175287280
Подробнее здесь: https://stackoverflow.com/questions/791 ... ween-files
Мобильная версия