-
-
Notifications
You must be signed in to change notification settings - Fork 54
FIX: Account form stdbool.h being included in Python.h #184
Conversation
As of CPython 3.11 (via python/cpython#29883) stdbool.h is now included in Python.h so do attempt to redefine bool/true/false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today I learned about __bool_true_false_are_defined
. Apparently the C standard requires that that definition appear in stdbool.h.
Any chance we can get a release with this fix included? We'd like to use (We can install from a git commit hash if not, but being able to pin a proper release seems better.) |
Sure, I can make a release this weekend. Note that you shouldn't need typed_ast for mypy/c as long as you're using >=3.8 and don't want to check Python 2 code. |
Oh, interesting. Our benchmark is using an older Thanks for your quick and helpful response! |
How old is the version you're using? With newer versions of mypy you should be careful because they come precompiled with mypyc, which is good for mypy's speed but makes it less useful for benchmarking CPython. It's likely to be fine for 3.11 since we don't provide compiled wheels for 3.11, but it may come up if you're trying to compare with released versions. |
The current version of the benchmark uses /~https://github.com/pyston/python-macrobenchmarks/blob/main/benchmarks/bm_mypy/requirements.txt I was able to get it working again by using If that's using mypyc, is there any way to force it to fall back to the pure-Python version? |
(Congrats on your promotion, by the way!) |
Looks like 0.790 already had mypyc wheels, but only up to 3.8: https://pypi.org/project/mypy/0.790/#files. You can avoid them by installing from the sdist, I think the pip invocation for that is (And thanks!) |
Thanks again, this change was released in 1.5.3 #185 |
As of CPython 3.11 (via python/cpython#29883) stdbool.h is now included in Python.h so do attempt to redefine bool/true/false.
I was not sure the easiest way to add this to #178 nor if this is the preferred way to do this in c.