Message46108
Logged In: YES
user_id=46639
I think that adding options to the existing APIs simply makes the Unicode
support feel tacked on (as it would be). It is also error prone, where if
you are following best practice and using Unicode everywhere, you have
to remember to explicitly pass the 'do_unicode=True' parameter to this
one particular function.
I think the alternative approach would be to use a codec, similar to how
Unicode DNS domains are handled
('foo@example.com'.decode('emailaddress')).
I still prefer the OO approach though, as it allows the programmer to
treat email addresses as a standard Unicode string with a few extra
features, such as the __cmp__ method I've since added to
EmailAddress.py and the test suite:
>>> e = EmailAddress(u'renee@ol\u00e9.de', u'Rene\u00e9 Acut\u00e9')
>>> e == str(e)
True
>>> e == unicode(e)
True
>>> e == str(EmailAddress(e.upper()))
True
>>> e == unicode(EmailAddress(e.upper()))
True |
|
Date |
User |
Action |
Args |
2007-08-23 15:37:59 | admin | link | issue963906 messages |
2007-08-23 15:37:59 | admin | create | |
|