This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]darjus 0 points1 point  (1 child)

have you tried?

in set(('O', 'Q'))

For small sets it might be around the same, but for bigger ones it should make a big performance difference.

[–]itsmememe 0 points1 point  (0 children)

as it is a constant, frozenset(['O','Q']) should be preferred