Room names, strings only? #2041
Answered
by
miguelgrinberg
Tomaster134
asked this question in
Q&A
-
I was digging through the documentation but I couldn't find anything specific, is it possible to have room names as something other than strings? I was wanting to have the room names correlate to a grid, but it seemed like when I used tuples it wasn't properly handling the room name. Let me know if I've missed something, thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
miguelgrinberg
Feb 29, 2024
Replies: 1 comment 5 replies
-
I have always assumed that room names would be strings, but I would imagine any type that can be a dictionary key would work. What error(s) did you get? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've found what the issue is. You can use non-string objects as room names, as long as they are not list-like or tuple-like. When you pass a list or tuple, it is assume that you are passing a collection of rooms, so I'm treating each component as a room name. So using
(0, 1)
would send to rooms0
and1
.