why not "'in' in 'in'"?
Grant Griffin
not.this at seebelow.org
Thu Jun 13 13:09:46 EDT 2002
In article <mailman.1023984257.8048.python-list at python.org>, "Mark says...
>
>> That's not a bad suggestion, Mark, but if I did that I guess I
>> would be forever wondering if I was testing whether the first one
>> was in the second or the second one was in the first.
>
>Since you insist on torturing yourself, then, why not name the function:
>
> def is_the_second_in_the_first(a, b):
> ...
>
>;-)
Naw, you got me all wrong. If torture was what I was after, I'd use lambda and
not name it anything at all:
>>> subject = 'spam, eggs, sausage, spam'
>>> eggs = 'eggs'
>>> if lambda x, y:y.find(x) >= 0(eggs, subject):
... print 'eggs is in subject'
...
eggs is in subject
or-better-yet,-write-it-in-perl-<wink>-ly y'rs,
=g2
_________________________________________________________________________
Grant R. Griffin g2 at dspguru.com
Publisher of dspGuru http://www.dspguru.com
Iowegian International Corporation http://www.iowegian.com
More information about the Python-list
mailing list