Re: InternationalPhoneNumber

"Stéphane Raimbault" <[email protected]> Thu, 16 Oct 2008 16:54:31 +0200
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
Extract from InternationalPhoneNumber(FancyValidator):

I propose to replace this:

for f, t in [('  ', ' '), ('--', '-'), (' - ', '-'), ('- ', '-'), (' -', '-')]:
            value = value.replace(f, t)
value = value.replace(' ', '')

by

value = value.replace(' ', '')
value = value.replace('--', '-')

Simpler, faster!

Stephane

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/