From 0cd595467d1635090c3fc2864c62009f66def2c7 2007-09-07 15:32:08 From: vivainio Date: 2007-09-07 15:32:08 Subject: [PATCH] add examples to SList.grep doc --- diff --git a/IPython/genutils.py b/IPython/genutils.py index a04333c..23a7f2a 100644 --- a/IPython/genutils.py +++ b/IPython/genutils.py @@ -5,7 +5,7 @@ General purpose utilities. This is a grab-bag of stuff I find useful in most programs I write. Some of these things are also convenient when working at the command line. -$Id: genutils.py 2726 2007-09-07 15:07:17Z vivainio $""" +$Id: genutils.py 2727 2007-09-07 15:32:08Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez. @@ -1013,6 +1013,11 @@ class SList(list): This is case-insensitive. If prune is true, return all items NOT matching the pattern. + + Examples:: + + a.grep( lambda x: x.startswith('C') ) + a.grep('Cha.*log', prune=1) """ if isinstance(pattern, basestring): pred = lambda x : re.search(pattern, x, re.IGNORECASE)