mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
__unicode__(): Patch # 541263 by Mikhail Zabaluev, implementation
modified by Barry.
This commit is contained in:
parent
ae64f3adcd
commit
8e69bdac33
1 changed files with 6 additions and 0 deletions
|
@ -142,6 +142,12 @@ class Header:
|
|||
"""A synonym for self.encode()."""
|
||||
return self.encode()
|
||||
|
||||
def __unicode__(self):
|
||||
"""Helper for the built-in unicode function."""
|
||||
# charset item is a Charset instance so we need to stringify it.
|
||||
uchunks = [unicode(s, str(charset)) for s, charset in self._chunks]
|
||||
return u''.join(uchunks)
|
||||
|
||||
def append(self, s, charset=None):
|
||||
"""Append string s with Charset charset to the MIME header.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue