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

Class Comment

Lib/email/_header_value_parser.py:273–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

get_commentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected