[Python] importing files twice from multiple files

Discussão em 'Python' iniciado por Stack, Julho 28, 2025.

  1. Stack

    Stack Membro Participativo

    imagine i have a "first.py" file with some code in it , and then i import it in another python file called "secend.py"
    then i import the "secend.py" file & "first.py" into "third.py" file ,,

    Will this cause any performance problems? (For example, a file is imported twice inside another file .. ?)

    I always run into this problem in Django projects.(if it is a problem)
    for example i have my models file
    and i import the models file into serialazers file
    and then i import both models & serializers file into views file


    maybe im not the best person at drawing things but there is a kinda stupid schematic that shows what im talking about ! : [​IMG]

    Continue reading...

Compartilhe esta Página