Skip to content
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

Merged
merged 3 commits into from
Aug 19, 2021

Conversation

jameslamb
Copy link
Collaborator

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 about basic.py or code imported from there

"""Join log messages from native library which come by chunks."""
msg_normalized = []
msg_normalized: List[str] = []

@wraps(func)
def wrapper(msg):
Copy link
Collaborator

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

Copy link
Collaborator Author

@jameslamb jameslamb Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh just missed it

Copy link
Collaborator Author

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

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done, LGTM!

@jameslamb jameslamb merged commit c65a2e3 into master Aug 19, 2021
@jameslamb jameslamb deleted the misc/type-hints-basic-logging branch August 19, 2021 04:38
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants