-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[python] add type hints to logging functions in basic.py #4527
Conversation
python-package/lightgbm/basic.py
Outdated
"""Join log messages from native library which come by chunks.""" | ||
msg_normalized = [] | ||
msg_normalized: List[str] = [] | ||
|
||
@wraps(func) | ||
def wrapper(msg): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was wrapper()
simply missed or you haven't annotated it due to problems with Union
in return type?
python/mypy#1693
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh just missed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in a1bec4e, mypy
didn't have any complaints so I think it's ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done, LGTM!
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Adds type hints to logging code in
python-package/lightgbm/basic.py
, as part of #3756.Notes for Reviewers
See #3756 (comment).
I ran
mypy --ignore-missing-imports python-package/lightgbm
and don't see any new warnings aboutbasic.py
or code imported from there