From 8ac19e9a9a61d3088fcc913eddcfde7c9f8886a3 Mon Sep 17 00:00:00 2001 From: "georg.brandl" Date: Fri, 16 May 2008 09:34:48 +0000 Subject: [PATCH] Make generator repr consistent with function and code object repr. git-svn-id: http://svn.python.org/projects/python/trunk@63364 6015fed2-1504-0410-9fe1-9d1591cc4771 --- Lib/test/test_generators.py | 2 +- Lib/test/test_genexps.py | 2 +- Objects/genobject.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 7be0a90abf..3702abc91a 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -927,7 +927,7 @@ Test the __name__ attribute and the repr() >>> g.__name__ 'f' >>> repr(g) # doctest: +ELLIPSIS -'' +'' """ # conjoin is a simple backtracking generator, named in honor of Icon's diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py index ab9f85d7a4..a86f12f03e 100644 --- a/Lib/test/test_genexps.py +++ b/Lib/test/test_genexps.py @@ -92,7 +92,7 @@ Verify that parenthesis are required when used as a keyword argument value Verify that parenthesis are required when used as a keyword argument value >>> dict(a = (i for i in xrange(10))) #doctest: +ELLIPSIS - {'a': < generator object at ...>} + {'a': at ...>} Verify early binding for the outermost for-expression diff --git a/Objects/genobject.c b/Objects/genobject.c index 3cd911d5f8..d2ef508837 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -288,7 +288,7 @@ gen_repr(PyGenObject *gen) code_name = PyString_AsString(((PyCodeObject *)gen->gi_code)->co_name); if (code_name == NULL) return NULL; - return PyString_FromFormat("<%.200s generator object at %p>", + return PyString_FromFormat("", code_name, gen); } -- 2.11.4.GIT