attribute. Deleting it, or setting it to a non-dictionary result in a
TypeError. Note that getting it the first time magically initializes
it to an empty dict so that func.__dict__ will always appear to be a
dictionary (never None).
Closes SF bug #446645.
- func.__dict__ is None until the first attribute is assigned
- del func.__dict__ is equivalent to func.__dict__ = None
- disallowing assignment to function attribute through unbound method
(it was always illegal to assign through bound method).
- verifying that setting attribute explicitly on underlying function
via meth.im_func is okay.
* 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