how to pass a custom object to re.search?

Lawrence Oluyede raims at dot.com
Fri Aug 17 16:04:15 CEST 2007


<brunovianarezende at gmail.com> wrote:
> Is it possible to make what I want (to pass a custom object to
> re.search)?

Try to implement __str__() for your object and provide a string
representation for it.

re.search(str(custom_object))

-- 
Lawrence, oluyede.org - neropercaso.it
"It is difficult to get a man to understand 
something when his salary depends on not
understanding it" - Upton Sinclair



More information about the Python-list mailing list