mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
This is my patch
[ 1004703 ] Make func_name writable plus fixing a couple of nits in the documentation changes spotted by MvL and a Misc/NEWS entry.
This commit is contained in:
parent
5523c2517f
commit
5e897959db
5 changed files with 94 additions and 46 deletions
|
@ -268,8 +268,15 @@ def test_func_name():
|
|||
def f(): pass
|
||||
verify(f.__name__ == "f")
|
||||
verify(f.func_name == "f")
|
||||
cantset(f, "func_name", "f")
|
||||
cantset(f, "__name__", "f")
|
||||
f.__name__ = "g"
|
||||
verify(f.__name__ == "g")
|
||||
verify(f.func_name == "g")
|
||||
f.func_name = "h"
|
||||
verify(f.__name__ == "h")
|
||||
verify(f.func_name == "h")
|
||||
cantset(f, "func_globals", 1)
|
||||
cantset(f, "__name__", 1)
|
||||
|
||||
|
||||
def test_func_code():
|
||||
def f(): pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue