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

Method __getitem__

Lib/email/message.py:422–431  ·  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

420 return len(self._headers)
421
422 def __getitem__(self, name):
423 """Get a header value.
424
425 Return None if the header is missing instead of raising an exception.
426
427 Note that if the header appeared multiple times, exactly which
428 occurrence gets returned is undefined. Use get_all() to get all
429 the values matching a header field name.
430 """
431 return self.get(name)
432
433 def __setitem__(self, name, val):
434 """Set the value of a header.

Callers

nothing calls this directly

Calls 1

getMethod · 0.95

Tested by

no test coverage detected