On 9/24/2010 2:45 PM, Tim Chase wrote:
On 09/24/10 13:01, Ethan Furman wrote:
John Posner wrote:
Another "missing feature" candidate: sublist
>>> 'bc' in 'abcde'
True
>>> list('bc') in list('abcde')
False
I'm not aware of any idioms, but how about a simple function?
Foldable into a one
On 09/24/10 13:01, Ethan Furman wrote:
John Posner wrote:
Another "missing feature" candidate: sublist
>>> 'bc' in 'abcde'
True
>>> list('bc') in list('abcde')
False
I'm not aware of any idioms, but how about a simple function?
def listinlist(list1, list2):
"checks if
John Posner wrote:
Another "missing feature" candidate: sublist
>>> 'bc' in 'abcde'
True
>>> list('bc') in list('abcde')
False
I'm not aware of any idioms, but how about a simple function?
def listinlist(list1, list2):
"checks if list1 is in list2"
if not list1:
re
On 9/24/2010 4:21 AM, Peter Otten wrote:
If you are not interested in the position of the substr use the "in"
operator:
if substr in s:
print "found"
else:
print "not found"
Another "missing feature" candidate: sublist
>>> 'bc' in 'abcde'
True
>>> list('bc') in list('abc
On Freitag 24 September 2010, Wim Feijen wrote:
> would really like having a string.contains('...') function
> which returns either True or False. I know I can mimick this
> behaviour by saying string.find('...') != -1 , however, I
> find this harder to read.
>>> a = 'xy134'
>>> '13' in a
True
>>
Wim Feijen wrote:
> I was wondering, how to make a feature request?
You can post suggestions to improve python on the python-ideas mailing list
or make feature requests on the bugtracker at bugs.python.org
> I would really like having a string.contains('...') function which returns
> either Tru
Hello,
I was wondering, how to make a feature request?
I would really like having a string.contains('...') function which returns
either True or False. I know I can mimick this behaviour by saying
string.find('...') != -1 , however, I find this harder to read.
string.contains('...') is easier to