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
d5270084
Commit
d5270084
authored
Jul 15, 2003
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nits.
parent
2820ca90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Doc/tut/tut.tex
Doc/tut/tut.tex
+2
-2
No files found.
Doc/tut/tut.tex
View file @
d5270084
...
...
@@ -3330,7 +3330,7 @@ be accessed or printed directly without having to reference \code{.args}.
... raise Exception
(
'spam', 'eggs'
)
... except Exception, inst:
... print type
(
inst
)
# the exception instance
... print inst.args
# arguments stored in .args
... print inst.args
# arguments stored in .args
... print inst #
__
str
__
allows args to printed directly
... x, y
=
inst #
__
getitem
__
allows args to be unpacked directly
... print 'x
=
', x
...
...
@@ -4299,7 +4299,7 @@ iterators as described in the previous section. What makes generators so
compact is that the
\method
{__
iter
__
()
}
and
\method
{
next
()
}
methods are
created automatically.
Another
other
key feature is that the local variables and execution state
Another key feature is that the local variables and execution state
are automatically saved between calls. This made the function easier to write
and much more clear than an approach using class variables like
\code
{
self.index
}
and
\code
{
self.data
}
.
...
...
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