diff --git a/docs/tutorial/relationship-attributes/type-annotation-strings.md b/docs/tutorial/relationship-attributes/type-annotation-strings.md index 780da6a962..3355900279 100644 --- a/docs/tutorial/relationship-attributes/type-annotation-strings.md +++ b/docs/tutorial/relationship-attributes/type-annotation-strings.md @@ -20,6 +20,8 @@ What's that about? Can't we just write it normally as `List[Hero]`? By that point, in that line in the code, the Python interpreter **doesn't know of any class `Hero`**, and if we put it just there, it would try to find it unsuccessfully, and then fail. 😭 +Unlike some other Python features, SQLModel does not require the import `from __future__ import annotations` to handle forward referenced type annotations. In fact, when working with SQLModel, this import will disrupt the mapping of forward referenced types. + But by putting it in quotes, in a string, the interpreter sees it as just a string with the text `"Hero"` inside. But the editor and other tools can see that **the string is actually a type annotation inside**, and provide all the autocompletion, type checks, etc. 🎉