class_docstr: Wrapper to avoid appearance in stack traces.
class_docstr_tok: ["Wrapper","to","avoid","appearance","in","stack","traces","."]
code: def add(self, signature, func):
      # Handle annotations
      if not signature:
          annotations = get_type_hints(func)
          annotations.pop("return", None)
          if annotations:
              signature = tuple(annotations.values())
  
      # Handle some union types by expanding at registration time
      if any(isinstance(typ, tuple) for typ in signature):
          for typs in expand_tuples(signature):
              self.add(typs, func)
          return
  
      # Handle variadic types
      signature = (
          Variadic[tuple(tp)] if isinstance(tp, list) else tp
          for tp in signature
      )
  
      signature = tuple(map(typing_wrap, signature))
      super().add(signature, func)
  
imports: from collections import defaultdict
  from multipledispatch.dispatcher import Dispatcher, expand_tuples
  from funsor.typing import Variadic, deep_type, get_origin, get_type_hints, typing_wrap
label_desc: Use image node_id 2 for calling the PartialDispatcher obj's underlying member method code with example usage: obj.add(signature, func) without return types