code: def test_c_classes(self):
      @singledispatch
      def g(obj):
          return "base"
  
      @g.register(decimal.DecimalException)
      def _(obj):
          return obj.args
  
      subn = decimal.Subnormal("Exponent < Emin")
      rnd = decimal.Rounded("Number got rounded")
      self.assertEqual(g(subn), ("Exponent < Emin",))
      self.assertEqual(g(rnd), ("Number got rounded",))
  
      @g.register(decimal.Subnormal)
      def _g(obj):
          return "Too small to care."
  
      self.assertEqual(g(subn), "Too small to care.")
      self.assertEqual(g(rnd), ("Number got rounded",))
  
imports: from __future__ import absolute_import
  import sys
  import doctest
  import unittest
  import decimal
  import inspect
  import functools
  import collections
  from collections import defaultdict
  from decorator import dispatch_on, contextmanager, decorator
label_desc: Use image node_id 6 for calling the TestSingleDispatch obj's underlying member method code with example usage: obj.test_c_classes() and returns: str, obj, str