extract_regex: encoding arg defaults to 'utf-8'

Sometimes it is not neccessary to pass the encoding argument. For
example, when the text argument is unicode. So set a default encoding.

Signed-off-by: Ping Yin <pkufranky@gmail.com>
This commit is contained in:
Ping Yin 2010-04-22 23:43:34 +08:00
parent 90fef3cbcd
commit 0aaa74d2bd
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ def load_object(path):
return obj
def extract_regex(regex, text, encoding):
def extract_regex(regex, text, encoding='utf-8'):
"""Extract a list of unicode strings from the given text/encoding using the following policies:
* if the regex contains a named group called "extract" that will be returned