class_docstr: Because there doesn't appear to be any other Markdown-friendly
  docstring support in Python.
  
  See also:
  
    * [PEP 256](https://www.python.org/dev/peps/pep-0256/)
    * [`inspect`](https://docs.python.org/3/library/inspect.html)
      
docstr: Extract the type annotation for a given method, correcting `typing`
  formatting problems as needed.
  
      sig:
  inspect signature for the method
  
      returns:
  corrected type annotation
          
docstr_tok: ["Extract","the","type","annotation","for","a","given","method",",","correcting","`","typing","`","formatting","problems","as","needed",".","sig",":","inspect","signature","for","the","method","returns",":","corrected","type","annotation"]
code: def extract_type_annotation(
      self,
      sig: inspect.Signature,
  ):
      """
      Extract the type annotation for a given method, correcting `typing`
      formatting problems as needed.
  
          sig:
      inspect signature for the method
  
          returns:
      corrected type annotation
      """
      type_name = str(sig)
      type_class = sig.__class__.__module__
  
      try:
          if type_class != "typing":
              if type_name.startswith("<class"):
                  type_name = type_name.split("'")[1]
  
          if type_name == "~AnyStr":
              type_name = "typing.AnyStr"
          elif type_name.startswith("~"):
              type_name = type_name[1:]
  
      except Exception:
          ic(type_name)
          traceback.print_exc()
      finally:
          return type_name
  
imports: from icecream import ic
  import inspect
  import os
  import re
  import sys
  import traceback
  import typing
label_desc: Use image node_id 11 for calling the PackageDoc obj's underlying member method code with example usage: obj.extract_type_annotation(sig) and returns: type_name