[Python] Importing classes just for typing in python?

Discussão em 'Python' iniciado por Stack, Setembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to use typing in Python 3.8 and I am a bit stuck. Example: I am mainly developing in main.py. I also have a class util.py that contains some helper functions an classes. But these classes also need to import classes from main.py for Typing. Now, when I want to use functions from util.py in main.py I also need to import it - but then I'll get an error because of circular importing (and rightly so).

    Is there a way around this?

    Continue reading...

Compartilhe esta Página