MCPcopy Index your code
hub / github.com/python/cpython / value

Method value

Lib/email/_header_value_parser.py:598–618  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

596
597 @property
598 def value(self):
599 quote = False
600 if self.defects:
601 quote = True
602 else:
603 for x in self:
604 if x.token_type == 'quoted-string':
605 quote = True
606 if len(self) != 0 and quote:
607 pre = post = ''
608 if (self[0].token_type == 'cfws' or
609 isinstance(self[0], TokenList) and
610 self[0][0].token_type == 'cfws'):
611 pre = ' '
612 if (self[-1].token_type == 'cfws' or
613 isinstance(self[-1], TokenList) and
614 self[-1][-1].token_type == 'cfws'):
615 post = ' '
616 return pre+quote_string(self.display_name)+post
617 else:
618 return super().value
619
620
621class LocalPart(TokenList):

Callers

nothing calls this directly

Calls 2

quote_stringFunction · 0.85
superClass · 0.85

Tested by

no test coverage detected