Skip to content

Conversation

PedanticHacker
Copy link
Contributor

@PedanticHacker PedanticHacker commented Jun 10, 2020

The default value of the arrows argument of the chess.svg.board() function can not be an empty tuple, it must be an empty list, since the arrows argument accepts a list of tuples. So, I think, we should fix that.

The default value of the 'arrows' argument of chess.svg.board() function can not be an empty tuple, it must be an empty list, since the 'arrows' argument accepts a list of tuples. So, I think, we should fix that.
@PedanticHacker
Copy link
Contributor Author

PedanticHacker commented Jun 10, 2020

It turns out that you can either pass () or [] in the arrows argument to chess.svg.board(), and nothing crashes, but it's more logical for its default value to be [] (i.e., an empty list), since the arrows argument accepts a list of tuples (or a list of Arrow objects) and not just tuples.

@niklasf
Copy link
Owner

niklasf commented Jun 11, 2020

I was trying to avoid the mutable default argument trap, but I think it's fine, because the argument is clearly intended to be read-only.

@niklasf niklasf merged commit d8247de into niklasf:master Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants