Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe89cc1

Browse files
committed
Remove proxy_print(), since that caused an inconsistency between
"print repr(proxy(a))" and "proxy(a)" at an interactive prompt. Closes SF bug #722763.
1 parent f425b1e commit fe89cc1

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

Objects/weakrefobject.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,6 @@ WRAP_BINARY(proxy_getattr, PyObject_GetAttr)
264264
WRAP_UNARY(proxy_str, PyObject_Str)
265265
WRAP_TERNARY(proxy_call, PyEval_CallObjectWithKeywords)
266266

267-
static int
268-
proxy_print(PyWeakReference *proxy, FILE *fp, int flags)
269-
{
270-
if (!proxy_checkref(proxy))
271-
return -1;
272-
return PyObject_Print(PyWeakref_GET_OBJECT(proxy), fp, flags);
273-
}
274-
275267
static PyObject *
276268
proxy_repr(PyWeakReference *proxy)
277269
{
@@ -479,7 +471,7 @@ _PyWeakref_ProxyType = {
479471
0,
480472
/* methods */
481473
(destructor)weakref_dealloc, /* tp_dealloc */
482-
(printfunc)proxy_print, /* tp_print */
474+
0, /* tp_print */
483475
0, /* tp_getattr */
484476
0, /* tp_setattr */
485477
proxy_compare, /* tp_compare */
@@ -514,7 +506,7 @@ _PyWeakref_CallableProxyType = {
514506
0,
515507
/* methods */
516508
(destructor)weakref_dealloc, /* tp_dealloc */
517-
(printfunc)proxy_print, /* tp_print */
509+
0, /* tp_print */
518510
0, /* tp_getattr */
519511
0, /* tp_setattr */
520512
proxy_compare, /* tp_compare */

0 commit comments

Comments
 (0)