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

Class Comment

Lib/email/_header_value_parser.py:280–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278
279
280class Comment(WhiteSpaceTokenList):
281
282 token_type = 'comment'
283
284 def __str__(self):
285 return ''.join(sum([
286 ["("],
287 [self.quote(x) for x in self],
288 [")"],
289 ], []))
290
291 def quote(self, value):
292 if value.token_type == 'comment':
293 return str(value)
294 return str(value).replace('\\', '\\\\').replace(
295 '(', r'\(').replace(
296 ')', r'\)')
297
298 @property
299 def content(self):
300 return ''.join(str(x) for x in self)
301
302 @property
303 def comments(self):
304 return [self.content]
305
306class AddressList(TokenList):
307

Callers 1

get_commentFunction · 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…