Source

intensional / intensional / contenthash.py

Diff from to

intensional/contenthash.py

     if considering & ID:
         hashval ^= _id    
 
+    code = None
     if considering & CODE:                    # CODE is the most important attribute, overriding all others
         code = getattr(obj, FUNC_ATTR, None)
         if code:
             hashval ^= hash(code)
-    elif considering & ATTRIBUTES: 
+    
+    if not code and considering & ATTRIBUTES: 
         try:
             hashval ^= chash(obj.__dict__, considering, seen)
         except AttributeError: