google / google/styleguide

Clarification needed regarding the use of the Walrus Operator

Open
#868 1 comment 3 reactions 1 assignee Claimed by @nathanielmanistaatgoogle View on GitHub
lang:python
Dominant language
HTML
Stars
39.6k
Forks
12.9k
Avg merge
42m
Merged PRs (30d)
15

Description

Hello,

I noticed that the current version of the Python style guide does not mention the Walrus Operator (`:=`), which was introduced in Python 3.8. I believe it would be beneficial to include a section discussing this operator, as it can impact code readability and maintainability. Are there any emerging standards or agreed good & bad practices for Walrus Operators that could be added to your python style guide? If you don't have anything in place maybe you can consider adopting the [PEP-572 style guide recommendations](https://peps.python.org/pep-0572/#style-guide-recommendations) as well as the examples provided by Tim Peters in [Appendix A](https://peps.python.org/pep-0572/#appendix-a-tim-peters-s-findings).

Thank you for considering this suggestion!

Best regards,
Diogo Rosário

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.