docstr: Connection is used as a dictionary key in Pipeline, it must be hashable
docstr_tok: ["Connection","is","used","as","a","dictionary","key","in","Pipeline",",","it","must","be","hashable"]
code: def __hash__(self):
      """
      Connection is used as a dictionary key in Pipeline, it must be hashable
      """
      return hash(
          "-".join(
              [
                  self.sender if self.sender else "input",
                  self.sender_socket.name if self.sender_socket else "",
                  self.receiver if self.receiver else "output",
                  self.receiver_socket.name
                  if self.receiver_socket
                  else "",
              ]
          )
      )
  
file_path: haystack/haystack/core/component/connection.py
imports: import itertools
  from typing import Optional, List, Tuple
  from dataclasses import dataclass
  from haystack.core.component.sockets import InputSocket, OutputSocket
  from haystack.core.type_utils import _type_name, _types_are_compatible
  from haystack.core.errors import PipelineConnectError
label_desc: Use image node_id 3 for calling the Connection obj's underlying member method code with example usage: obj.__hash__() and returns: hash