Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cpython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
cpython
Commits
a0562cf1113a
Commit
a0562cf1113a
authored
4 years ago
by
Terry Jan Reedy
Browse files
Options
Downloads
Patches
Plain Diff
bpo-43199: Briefly explain why no goto (GH-24852)
Answer "Why is there no goto?" in the Design and History FAQ.
parent
27dc3c6c4bda
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Doc/faq/design.rst
+9
-1
9 additions, 1 deletion
Doc/faq/design.rst
Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst
+1
-0
1 addition, 0 deletions
...xt/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst
with
10 additions
and
1 deletion
Doc/faq/design.rst
+
9
−
1
View file @
a0562cf1
...
...
@@ -600,7 +600,15 @@
Why is there no goto?
---------------------
You can use exceptions to provide a "structured goto" that even works across
In the 1970s people realized that unrestricted goto could lead
to messy "sphagetti" code that was hard to understand and revise.
In a high-level language, it is also unneeded as long as there
are ways to branch (in Python, with ``if`` statements and ``or``,
``and``, and ``if-else`` expressions) and loop (with ``while``
and ``for`` statements, possibly containing ``continue`` and ``break``).
One can also use exceptions to provide a "structured goto"
that works even across
function calls. Many feel that exceptions can conveniently emulate all
reasonable uses of the "go" or "goto" constructs of C, Fortran, and other
languages. For example::
...
...
This diff is collapsed.
Click to expand it.
Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst
0 → 100644
+
1
−
0
View file @
a0562cf1
Answer "Why is there no goto?" in the Design and History FAQ.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment