Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsal pablogsal commented Mar 7, 2020

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting core review labels Mar 7, 2020
@pablogsal pablogsal added skip news and removed awaiting core review docs Documentation in the Doc dir labels Mar 7, 2020
Co-Authored-By: Serhiy Storchaka <[email protected]>
@pablogsal
Copy link
Member Author

It would be nice to use single quotes which are default in Python.

Commit a8b092b moves all examples to use single quotes when possible

op=USub(),
operand=Name(id='a', ctx=Load())))],
type_ignores=[])
>>> print(ast.dump(ast.parse('-a', mode='eval'), indent=4))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example should use the "exec" mode.

Copy link
Member Author

@pablogsal pablogsal Mar 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate on the reason why? The difference between the two trees does not add anything that stands out to me:

>>> print(ast.dump(ast.parse('-a', mode='eval'), indent=4))
Expression(
    body=UnaryOp(
        op=USub(),
        operand=Name(id='a', ctx=Load())))
>>> print(ast.dump(ast.parse('-a', mode='exec'), indent=4))
Module(
    body=[
        Expr(
            value=UnaryOp(
                op=USub(),
                operand=Name(id='a', ctx=Load())))],
    type_ignores=[])

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an example for the Expr node.

Copy link
Member Author

@pablogsal pablogsal Mar 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️ Whops! Thanks, I clearly need more coffee.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pablogsal
Copy link
Member Author

Thank you very much @serhiy-storchaka for the awesome review! :)

@pablogsal pablogsal merged commit 02f64cb into python:master Mar 7, 2020
@pablogsal pablogsal deleted the bpo-39199-2 branch March 7, 2020 18:23
@serhiy-storchaka
Copy link
Member

Thank you for the great improvement of the documentation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants