I'm manually creating a pyi file for one of my classes and one of its function return types relies on an enum I made in another file.
Relevant code snippets: Board.pyi
class Board:
def access(self, i: int, j: int) -> Color: ...
Where Color
is the enum. To resolve the fact that Color
is not defined in the pyi file, should I just import it from Color.py
/ Color.pyi
or is there another solution that's detailed by PEP?
You can use a normal
import
statement to bring in any types you need in your.pyi
file. The official type stub documentation has this as an example: