MCPcopy Index your code
hub / github.com/RustPython/RustPython / value

Method value

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

lenFunction · 0.85
isinstanceFunction · 0.85
quote_stringFunction · 0.85
superClass · 0.85

Tested by

no test coverage detected