virtualEnvironment/lib/python2.7/site-packages/coverage/misc.py
def update(self, v):
        """Add `v` to the hash, recursively if needed."""
        self.md5.update(to_bytes(str(type(v))))
        if isinstance(v, string_class):
            self.md5.update(to_bytes(v))
        elif v is None:
            pass
        elif isinstance(v, (int, float)):
            self.md5.update(to_bytes(str(v)))
        elif isinstance(v, (tuple, list)):
            for e in v:
                self.update(e)
        elif isinstance(v, dict):
            keys = v.keys()
            for k in sorted(keys):
                self.update(k)
                self.update(v[k])
        else:
            for k in dir(v):
                if k.startswith('__'):
                    continue
                a = getattr(v, k)
                if inspect.isroutine(a):
                    continue
                self.update(k)
                self.update(a)
def update(self, v):
        """Add `v` to the hash, recursively if needed."""
        self.md5.update(to_bytes(str(type(v))))
        if isinstance(v, string_class):
            self.md5.update(to_bytes(v))
        elif v is None:
            pass
        elif isinstance(v, (int, float)):
            self.md5.update(to_bytes(str(v)))
        elif isinstance(v, (tuple, list)):
            for e in v:
                self.update(e)
        elif isinstance(v, dict):
            keys = v.keys()
            for k in sorted(keys):
                self.update(k)
                self.update(v[k])
        else:
            for k in dir(v):
                if k.startswith('__'):
                    continue
                a = getattr(v, k)
                if inspect.isroutine(a):
                    continue
                self.update(k)
                self.update(a)
def update ( self , v ) : self . md5 . update ( to_bytes ( str ( type ( v ) ) ) ) if isinstance ( v , string_class ) : self . md5 . update ( to_bytes ( v ) ) elif v is None : pass elif isinstance ( v , ( int , float ) ) : self . md5 . update ( to_bytes ( str ( v ) ) ) elif isinstance ( v , ( tuple , list ) ) : for e in v : self . update ( e ) elif isinstance ( v , dict ) : keys = v . keys ( ) for k in sorted ( keys ) : self . update ( k ) self . update ( v [ k ] ) else : for k in dir ( v ) : if k . startswith ( '__' ) : continue a = getattr ( v , k ) if inspect . isroutine ( a ) : continue self . update ( k ) self . update ( a )
Add `v` to the hash, recursively if needed.
Add v to the hash recursively if needed .