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-package] fix mypy error about eval result tuples #6105

Merged
merged 2 commits into from
Sep 19, 2023

Conversation

jameslamb
Copy link
Collaborator

Contributes to #3756.
Contributes to #3867.

Resolves the following error from mypy:

callback.py:167: error: Tuple index out of range  [misc]

That's raised in code that works with eval result tuples, which can be either 4 or 5 elements. Per the discussion in python/mypy#1178, mypy can't use branches like if len(tup) to figure out which element of a union type it must be working with.

@jameslamb
Copy link
Collaborator Author

Getting closer! We're going to be enforcing mypy --strict by the end of 2023, that's my goal 🤞🏻

@jameslamb jameslamb merged commit aa489f4 into master Sep 19, 2023
39 checks passed
@jameslamb jameslamb deleted the python/mypy-eval-results branch September 19, 2023 20:22
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 Dec 20, 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