mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Ouch, it's Carlo Verre, not Verre Carlo.
This commit is contained in:
parent
357981e99d
commit
52b2705e9c
2 changed files with 6 additions and 6 deletions
|
@ -3840,21 +3840,21 @@ def proxysuper():
|
||||||
p = Proxy(obj)
|
p = Proxy(obj)
|
||||||
vereq(C.__dict__["f"](p), "B.f->C.f")
|
vereq(C.__dict__["f"](p), "B.f->C.f")
|
||||||
|
|
||||||
def verrecarlo():
|
def carloverre():
|
||||||
if verbose:
|
if verbose:
|
||||||
print "Testing prohibition of Verre Carlo's hack..."
|
print "Testing prohibition of Carlo Verre's hack..."
|
||||||
try:
|
try:
|
||||||
object.__setattr__(str, "foo", 42)
|
object.__setattr__(str, "foo", 42)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise TestFailed, "Verre Carlo __setattr__ suceeded!"
|
raise TestFailed, "Carlo Verre __setattr__ suceeded!"
|
||||||
try:
|
try:
|
||||||
object.__delattr__(str, "lower")
|
object.__delattr__(str, "lower")
|
||||||
except TypeError:
|
except TypeError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise TestFailed, "Verre Carlo __delattr__ succeeded!"
|
raise TestFailed, "Carlo Verre __delattr__ succeeded!"
|
||||||
|
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
|
@ -3945,7 +3945,7 @@ def test_main():
|
||||||
meth_class_get()
|
meth_class_get()
|
||||||
isinst_isclass()
|
isinst_isclass()
|
||||||
proxysuper()
|
proxysuper()
|
||||||
verrecarlo()
|
carloverre()
|
||||||
|
|
||||||
if verbose: print "All OK"
|
if verbose: print "All OK"
|
||||||
|
|
||||||
|
|
|
@ -3575,7 +3575,7 @@ wrap_cmpfunc(PyObject *self, PyObject *args, void *wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Helper to check for object.__setattr__ or __delattr__ applied to a type.
|
/* Helper to check for object.__setattr__ or __delattr__ applied to a type.
|
||||||
This is called the Verre Carlo hack after its discoverer. */
|
This is called the Carlo Verre hack after its discoverer. */
|
||||||
static int
|
static int
|
||||||
hackcheck(PyObject *self, setattrofunc func, char *what)
|
hackcheck(PyObject *self, setattrofunc func, char *what)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue