GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up|
Thanks! Generally looks good, I have few minor comments. |
|
oops, I made some stupid mistakes And seems like the @overload case does not apply to this fix |
|
I add new logic in |
|
Thanks for updates! Here are couple more comments. |
|
This is still not ready, I have few more comments. |
|
Good catch and thanks for the careful review! I check the logic again and indeed there are some mistakes, here's the update:
|
|
Almost ready now, just couple small comments. |
|
To address that |
|
LGTM! (assuming the tests pass) |
TH3CHARLie commentedDec 19, 2019
•
edited by ilevkivskyi
Resolves #8161
According to comments of
lookupinmypy/semanal.py, when we look up a class attribute, we require that it is defined textually before the reference statement, thus line number is used for comparison.When function has decorators, its line number is determined by the top decorator instead of the
def. That's why #8161's code fails because on line 8, theAinType[A]has the line number of 8 while the @staticmethod functionAhas the line number of 7 due to the decorator.Thus we need to properly handle this by introducing the number of decorators when deciding textural precedence.