[Python-ideas] '' in 'abc' == True

anatoly techtonik techtonik at gmail.com
Wed Jul 18 19:30:02 CEST 2012


I've just spotted inconsistency between string and lists handling:

>>> '' in 'abc'
True
>>> '' in 'abc'.split()
False
>>> [] in ['a', 'b', 'c']
False

Why strings here behave differently than other sequence types? Is that
by design?



More information about the Python-ideas mailing list