Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 5, 2024
1 parent dd0cbd1 commit 483d943
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/data/messages/s/singledispatch-method/good.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
def convert_position(position):
print(position)


@convert_position.register
def _(position: str) -> tuple:
position_a, position_b = position.split(",")
return (int(position_a), int(position_b))


@convert_position.register
def _(position: tuple) -> str:
return f"{position[0]},{position[1]}"
2 changes: 2 additions & 0 deletions doc/data/messages/s/singledispatchmethod-function/bad.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
def convert_position(position):
print(position)


@convert_position.register # [singledispatchmethod-function]
def _(position: str) -> tuple:
position_a, position_b = position.split(",")
return (int(position_a), int(position_b))


@convert_position.register # [singledispatchmethod-function]
def _(position: tuple) -> str:
return f"{position[0]},{position[1]}"

0 comments on commit 483d943

Please sign in to comment.