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

Method __getitem__

Lib/wsgiref/headers.py:74–83  ·  view source on GitHub ↗

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

(self,name)

Source from the content-addressed store, hash-verified

72 self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name]
73
74 def __getitem__(self,name):
75 """Get the first header value for 'name'
76
77 Return None if the header is missing instead of raising an exception.
78
79 Note that if the header appeared multiple times, the first exactly which
80 occurrence gets returned is undefined. Use getall() to get all
81 the values matching a header field name.
82 """
83 return self.get(name)
84
85 def __contains__(self, name):
86 """Return true if the message contains the header."""

Callers

nothing calls this directly

Calls 1

getMethod · 0.95

Tested by

no test coverage detected