Possible documentation bug (missing imports) #11498
Unanswered
miiichael
asked this question in
Usage Questions
Replies: 1 comment
-
Hi, Thanks for reporting. PR to fix would be appreciated |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't know if this is a common problem (I'm not about to cut and paste every example in the docs...), but it looks like the example at https://docs.sqlalchemy.org/en/20/orm/basic_relationships.html#many-to-many cannot possibly work because
List
is not imported anywhere. When I try it:Now you're probably going to point out that there is a block of imports at the top of the page that does include
List
, however the example itself includes a mostly-overlapping set of imports, and I feel that it is reasonable to conclude that the example therefore intends to include all its own imports. For consistency you should probably choose which way you wish to go. Personally I think the "every example lists its own imports" approach is more usable, as it makes each example self-contained, and spares folks from having to jump up and down the page to cut and paste multiple chunks just to make a working example.It would be really good to soften the learning curve if us newbies didn't have to fight unnecessary errors within the examples.
Beta Was this translation helpful? Give feedback.
All reactions