New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mislabeling of a dict comprehension as a generator expression in the tutorial #76903
Comments
In the Python tutorial, in "9. Classes", in "9.10 Generator expression", a list of sample generator expressions used as arguments to functions is given. However, one of the examples isn't a generator expression, it's a set comprehension. sine_table = {x: sin(x*pi/180) for x in range(0, 91)} Perhaps this used to be a call to set() and was mistakenly converted? |
Correction: it's a dictionary comprehension, and it did indeed used to be a call to dict() in the 2.7 documentation. |
This example is also in 2.7 -> I add 2.7 |
I agree that 2.7 is incorrect also, 2.7 has dict comprehensions also so there's no reason to pass a generator expression to dict(). I add 3.4 and 3.8 because they also have the problem. |
I treat it as an enhancement so only merge it into 3.8. Thanks Soothsayer for the report and Stéphane for the patch! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: