Characters contain themselves?

Graham Fawcett graham.fawcett at gmail.com
Tue Apr 11 09:29:34 EDT 2006


Sion Arrowsmith wrote:
> Unfortunately:
> >>> print 'a'+'bc' |ips| 'abc'
> True
>
> Which might not be what you want. On the other hand, it's a simple
> fix:
> >>> ips = Infix(lambda a, b: (a != b) and (a in b))
> >>> print 'a'+'bc' |ips| 'abc'

Ah, good point.

Graham




More information about the Python-list mailing list