On 30May2017 12:06, Peter Otten <__pete...@web.de> wrote:
Cameron Simpson wrote:
As written it should be a bit slower: to construct a set each member get
tested for presence. The cost is in making the set, not in searching it.

No, CPython is a bit smarter than that:

dis.dis('if m in {"1", "January"}: pass')
 1           0 LOAD_NAME                0 (m)
             2 LOAD_CONST               3 (frozenset({'1', 'January'}))

Ah, I was wonderig about things like that during today...

[ More cool info snipped... ]

Thanks,
Cameron Simpson <c...@zip.com.au>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to