MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __getitem__

Method __getitem__

tools/python-3.11.9-amd64/Lib/email/message.py:410–419  ·  view source on GitHub ↗

Get a header value. Return None if the header is missing instead of raising an exception. Note that if the header appeared multiple times, exactly which occurrence gets returned is undefined. Use get_all() to get all the values matching a header field name.

(self, name)

Source from the content-addressed store, hash-verified

408 return len(self._headers)
409
410 def __getitem__(self, name):
411 """Get a header value.
412
413 Return None if the header is missing instead of raising an exception.
414
415 Note that if the header appeared multiple times, exactly which
416 occurrence gets returned is undefined. Use get_all() to get all
417 the values matching a header field name.
418 """
419 return self.get(name)
420
421 def __setitem__(self, name, val):
422 """Set the value of a header.

Callers

nothing calls this directly

Calls 1

getMethod · 0.95

Tested by

no test coverage detected