This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Python should enable computed gotos on Mac by default
Type: behavior Stage: resolved
Components: macOS Versions: Python 3.10
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, laike9m, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2020-05-27 07:13 by laike9m, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (7)
msg370051 - (view) Author: laike9m (laike9m) * Date: 2020-05-27 07:13
Issue is described here with more details:

Basically, when building on Mac, Python should enable computed gotos by default, because it is supported (

The documentation( says
> Computed gotos are now enabled by default on supported compilers (which are detected by the configure script). They can still be disabled selectively by specifying --without-computed-gotos.

This seems to imply that the capability detection is wrong.
msg370082 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2020-05-27 13:50
The configure script sets the result of compiler probing with HAVE_COMPUTED_GOTOS not USE_COMPUTED_GOTOS.
msg370162 - (view) Author: laike9m (laike9m) * Date: 2020-05-28 03:07
Hi Benjamin, do you mean that disabling computed gotos on Mac is the expected behavior?
msg370166 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2020-05-28 07:24
The result of auto detection of computed gotos can be seen using the HAVE_COMPUTED_GOTOS macro, not the USE_... one. 

Computed gotos should work on macOS, and does on my machine.
msg370523 - (view) Author: laike9m (laike9m) * Date: 2020-06-01 00:41
Thanks Ronald. I wrote an answer to summarize what I got so far:

There's nothing wrong with the current behavior, so nothing really needs to be changed. But we still lack a way for users to check whether computed gotos is enabled out of the box, and `HAVE_COMPUTED_GOTOS` can't do the job either since it only detects the compiler's capability.
msg370541 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2020-06-01 07:51
Looking at the source code at <>: computed gotos are enabled automatically when they are available.
msg370542 - (view) Author: laike9m (laike9m) * Date: 2020-06-01 07:57
You're right. The part I don't understand is how `--without-computed-gotos`
disabled the feature. Also I guess since this feature is meant to be
transparent to users, it's ok to not have a way to inspect it.

On Mon, Jun 1, 2020 at 12:51 AM Ronald Oussoren <>

> Ronald Oussoren <> added the comment:
> Looking at the source code at <
> computed gotos are enabled automatically when they are available.
> ----------
> _______________________________________
> Python tracker <>
> <>
> _______________________________________
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84967
2020-06-01 07:57:00laike9msetmessages: + msg370542
2020-06-01 07:51:48ronaldoussorensetmessages: + msg370541
2020-06-01 00:41:26laike9msetmessages: + msg370523
2020-05-28 07:24:01ronaldoussorensetmessages: + msg370166
2020-05-28 03:07:28laike9msetmessages: + msg370162
2020-05-27 13:50:45benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg370082

resolution: works for me
stage: resolved
2020-05-27 07:13:03laike9mcreate