The one thing I love more then writing code is deleting code.
* Removed func_hash and func_compare, so they can be treated as immutable
content-less objects (address hash and comparison)
* Added tests to that affect to test_funcattrs (also testing func_code
is writable)
* Reverse meaning of tests in test_opcodes which checked identical code
gets identical functions
diff --git a/Lib/test/test_funcattrs.py b/Lib/test/test_funcattrs.py
index 9c07a8f..0591ba6 100644
--- a/Lib/test/test_funcattrs.py
+++ b/Lib/test/test_funcattrs.py
@@ -154,3 +154,22 @@
# This isn't specifically related to function attributes, but it does test a
# core dump regression in funcobject.c
del another.func_defaults
+
+def foo():
+ pass
+
+def bar():
+ pass
+
+def temp():
+ print 1
+
+if foo==bar: raise TestFailed
+
+d={}
+d[foo] = 1
+
+foo.func_code = temp.func_code
+
+d[foo]
+