mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Add more ruff rules (#8767)
* Add more ruff rules * Add more ruff rules * pre-commit: Update ruff v0.0.269 -> v0.0.270 * Apply suggestions from code review * Fix doctest * Fix doctest (ignore whitespace) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -174,12 +174,12 @@ def _validate_input(points: list[Point] | list[list[float]]) -> list[Point]:
|
||||
"""
|
||||
|
||||
if not hasattr(points, "__iter__"):
|
||||
raise ValueError(
|
||||
f"Expecting an iterable object but got an non-iterable type {points}"
|
||||
)
|
||||
msg = f"Expecting an iterable object but got an non-iterable type {points}"
|
||||
raise ValueError(msg)
|
||||
|
||||
if not points:
|
||||
raise ValueError(f"Expecting a list of points but got {points}")
|
||||
msg = f"Expecting a list of points but got {points}"
|
||||
raise ValueError(msg)
|
||||
|
||||
return _construct_points(points)
|
||||
|
||||
|
Reference in New Issue
Block a user