summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohit Balasubramanian <brohit23@outlook.com>2017-10-07 05:27:36 (GMT)
committerMariatta <Mariatta@users.noreply.github.com>2017-10-07 05:27:36 (GMT)
commit93c0885dc84381cbbb970402b1a21bf690ee312c (patch)
tree259e6d6314274400eea2a78bffaadd1a7bdb477d
parent051295a8c57cc649fa5eaa43526143984a147411 (diff)
downloadcpython-93c0885dc84381cbbb970402b1a21bf690ee312c.zip
cpython-93c0885dc84381cbbb970402b1a21bf690ee312c.tar.gz
cpython-93c0885dc84381cbbb970402b1a21bf690ee312c.tar.bz2
bpo-31507 Add docstring to parseaddr function in email.utils.parseaddr (GH-3647) (GH-3733)
(cherry picked from commit 9e7b9b21fe45f7d93eaf9382fedfa18247d0d2b2)
-rw-r--r--Lib/email/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/email/utils.py b/Lib/email/utils.py
index a759d23..e2bfb36 100644
--- a/Lib/email/utils.py
+++ b/Lib/email/utils.py
@@ -215,6 +215,12 @@ def parsedate_to_datetime(data):
def parseaddr(addr):
+ """
+ Parse addr into its constituent realname and email address parts.
+
+ Return a tuple of realname and email address, unless the parse fails, in
+ which case return a 2-tuple of ('', '').
+ """
addrs = _AddressList(addr).addresslist
if not addrs:
return '', ''