Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5ffad664
Commit
5ffad664
authored
May 16, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make generator repr consistent with function and code object repr.
parent
a8eaf8fa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
Lib/test/test_generators.py
Lib/test/test_generators.py
+1
-1
Lib/test/test_genexps.py
Lib/test/test_genexps.py
+1
-1
Objects/genobject.c
Objects/genobject.c
+1
-1
No files found.
Lib/test/test_generators.py
View file @
5ffad664
...
...
@@ -927,7 +927,7 @@ Test the __name__ attribute and the repr()
>>> g.__name__
'f'
>>> repr(g) # doctest: +ELLIPSIS
'<
f generator object
at ...>'
'<
generator object f
at ...>'
"""
# conjoin is a simple backtracking generator, named in honor of Icon's
...
...
Lib/test/test_genexps.py
View file @
5ffad664
...
...
@@ -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': <
<genexpr> generator object
at ...>}
{'a': <
generator object <genexpr>
at ...>}
Verify early binding for the outermost for-expression
...
...
Objects/genobject.c
View file @
5ffad664
...
...
@@ -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
(
"<
generator object %.200s
at %p>"
,
code_name
,
gen
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment