comparing all values of a list to regex
Manuel Hendel
manuel at hendel.net
Fri Sep 27 05:13:25 EDT 2002
Sorry for forgetting some details.
On Fri, Sep 27, 2002 at 08:07:24AM +0000, Alex Martelli wrote:
>
> def classify(login_email):
> l_e = login_email.split(',')
I think that I nearly understand what you are doing here. But I don't
understand the assert part. I already checked at the documentations
but this doesn't helped me at all.
> assert 1 <= len(l_e) <= 2, "More than one comma in (%s)" % login_email
> if len(l_e)==2: return 2 # both
> elif l_e.find('@'): return 1 # email, I guess
> else return 0 # other case (local account, I guess)
Manuel
--
From '86 until the summer of last year, wherever I went, people would say,
"You would have made a great James Bond! Weren't you going to be James Bond?
You should have been, you could have been, you may have been." Yes, yes, yes,
yes, yes. It was like unfinished business in my life. I couldn't say no to it
this time around.
-Pierce Brosnan
More information about the Python-list
mailing list