code: def _infer_dict(obj):
      '''Return True for likely dict object.
      '''
      for ats in (('__len__', 'get', 'has_key',     'items',     'keys',     'values'),
                  ('__len__', 'get', 'has_key', 'iteritems', 'iterkeys', 'itervalues')):
          for a in ats:  # no all(<generator_expression>) in Python 2.2
              if not _callable(getattr(obj, a, None)):
                  break
          else:  # all True
              return True
      return Falsf _infer_dict(obj):
      '''Return True for likely dict object.
      '''
      for ats in (('__len__', 'get', 'has_key',     'items',     'keys',     'values'),
                  ('__len__', 'get', 'has_key', 'iteritems', 'iterkeys', 'itervalues')):
          for a in ats:  # no all(<generator_expression>) in Python 2.2
              if not _callable(getattr(obj, a, None)):
                  break
          else:  # all True
              return True
      return False
docs: Return True for likely dict object.