docstr: A test against the regression mentioned at `github issue 29`_.
  
  The indent parameter should accept any type which pretends to be
  an instance of int or long when it comes to being multiplied by
  strings, even if it is not actually an int or long, for
  backwards compatibility.
  
  .. _github issue 29:
     http://github.com/simplejson/simplejson/issue/29
docstr_tok: ["A","test","against","the","regression","mentioned","at","`","github","issue","29","`","_",".","The","indent","parameter","should","accept","any","type","which","pretends","to","be","an","instance","of","int","or","long","when","it","comes","to","being","multiplied","by","strings",",","even","if","it","is","not","actually","an","int","or","long",",","for","backwards","compatibility",".","..","_github","issue","29",":","http",":","\/\/github.com\/simplejson\/simplejson\/issue\/29"]
code: def test_indent_unknown_type_acceptance(self):
      """
      A test against the regression mentioned at `github issue 29`_.
  
      The indent parameter should accept any type which pretends to be
      an instance of int or long when it comes to being multiplied by
      strings, even if it is not actually an int or long, for
      backwards compatibility.
  
      .. _github issue 29:
         http://github.com/simplejson/simplejson/issue/29
      """
  
      class AwesomeInt(object):
          """An awesome reimplementation of integers"""
  
          def __init__(self, *args, **kwargs):
              if len(args) > 0:
                  # [construct from literals, objects, etc.]
                  # ...
  
                  # Finally, if args[0] is an integer, store it
                  if isinstance(args[0], int):
                      self._int = args[0]
  
          # [various methods]
  
          def __mul__(self, other):
              # [various ways to multiply AwesomeInt objects]
              # ... finally, if the right-hand operand is not awesome enough,
              # try to do a normal integer multiplication
              if hasattr(self, "_int"):
                  return self._int * other
              else:
                  raise NotImplementedError(
                      "To do non-awesome things with"
                      " this object, please construct it from an integer!"
                  )
  
      s = json.dumps([0, 1, 2], indent=AwesomeInt(3))
      self.assertEqual(s, "[\n   0,\n   1,\n   2\n]")
  
imports: from unittest import TestCase
  from simplejson.compat import StringIO, long_type, b, binary_type, text_type, PY3
  import simplejson
label_desc: Use image node_id 7 for calling the TestDump obj's underlying member method code with example usage: obj.test_indent_unknown_type_acceptance() and returns: unknown