Does order of defining classes matter? #6009
Unanswered
pk1234pk1234dva-a11y
asked this question in
Q&A
Replies: 1 comment
|
The order is irrelevant as long as all classes are registered before any of the bound methods is actually invoked from Python — which, for the pattern in your snippet (everything inside one The mechanism:
Inside a single Where it does start to matter:
For your |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Suppose you are declaring classes. Sometimes a method of one class returns another class. I wonder, is it needed for the class that is e.g. returned, to be defined before the method that uses it, or is the order irrelevant?
As an example:
This seems to work fine, despite
Bookbeing declared afterFindBook, whereFindBookreturnsBook*. So it seems that things are resolved in some deferred/lazy way. Still, I couldn't find documentation about this, and perhaps things are only working by chance.Can I rely on the order of class definitions being irrelevant, as far as return types and argument types go?
All reactions