def __getitem__(self, extension_handle):
_VerifyExtensionHandle(self._extended_message, extension_handle)<EOL>result = self._extended_message._fields.get(extension_handle)<EOL>if result is not None:<EOL><INDENT>return result<EOL><DEDENT>if extension_handle.label == _FieldDescriptor.LABEL_REPEATED:<EOL><INDENT>result = extension_handle._default_constructor(self._extended_message)<EOL><DEDENT>elif extension_handle.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:<EOL><INDENT>result = extension_handle.message_type._concrete_class()<EOL>try:<EOL><INDENT>result._SetListener(self._extended_message._listener_for_children)<EOL><DEDENT>except ReferenceError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return extension_handle.default_value<EOL><DEDENT>result = self._extended_message._fields.setdefault(<EOL>extension_handle, result)<EOL>return result<EOL>
Returns the current value of the given extension handle.