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

Class Parameter

Lib/email/_header_value_parser.py:680–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678
679
680class Parameter(TokenList):
681
682 token_type = 'parameter'
683 sectioned = False
684 extended = False
685 charset = 'us-ascii'
686
687 @property
688 def section_number(self):
689 # Because the first token, the attribute (name) eats CFWS, the second
690 # token is always the section if there is one.
691 return self[1].number if self.sectioned else 0
692
693 @property
694 def param_value(self):
695 # This is part of the "handle quoted extended parameters" hack.
696 for token in self:
697 if token.token_type == 'value':
698 return token.stripped_value
699 if token.token_type == 'quoted-string':
700 for token in token:
701 if token.token_type == 'bare-quoted-string':
702 for token in token:
703 if token.token_type == 'value':
704 return token.stripped_value
705 return ''
706
707
708class InvalidParameter(Parameter):

Callers 1

get_parameterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…