Skip to content

Commit

Permalink
html can now return none
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Jan 5, 2024
1 parent 5ed1300 commit 0a36534
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/examples/python/tutorial_tic_tac_toe/tic_tac_toe.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
def square(value, on_square_click):
return html.button(
{"className": "square", "on_click": on_square_click},
value or "",
value,
)


@component
def board(x_is_next, squares, on_play):

def handle_click(i):
def handle_click_event(_event):
"""Due to a quirk of Python, if your event handler needs args other than
"""
Due to a quirk of Python, if your event handler needs args other than
`event`, you will need to create a wrapper function as seen above.
Ref: https://pylint.readthedocs.io/en/stable/user_guide/messages/warning/cell-var-from-loop.html"""
Ref: https://pylint.readthedocs.io/en/stable/user_guide/messages/warning/cell-var-from-loop.html
"""
if calculate_winner(squares) or squares[i]:
return

Expand Down

0 comments on commit 0a36534

Please sign in to comment.