Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
docs: Update Python guidance in code style.
Karl Stolley5ff853fa7196
diff --git a/docs/contributing/code-style.md b/docs/contributing/code-style.mdindex b63f0434b3d..39b746c318d 100644--- a/docs/contributing/code-style.md+++ b/docs/contributing/code-style.md@@ -131,13 +131,12 @@ rules about integrating third-party projects.tool](../testing/linters.md) enforces this by running Black andisort in check mode, or in write mode with`tools/lint --only=black,isort --fix`. You may find it helpful to- [integrate- Black](https://black.readthedocs.io/en/stable/integrations/editors.html)+ [integrate Black](https://black.readthedocs.io/en/stable/integrations/editors.html)and[isort](https://pycqa.github.io/isort/#installing-isorts-for-your-preferred-text-editor)with your editor.- Don't put a shebang line on a Python file unless it's meaningful to- run it as a script. (Some libraries can also be run as scripts, e.g.+ run it as a script. (Some libraries can also be run as scripts, e.g.,to run a test suite.)- Scripts should be executed directly (`./script.py`), so that theinterpreter is implicitly found from the shebang line, rather than@@ -145,12 +144,10 @@ rules about integrating third-party projects.- Put all imports together at the top of the file, absent a compellingreason to do otherwise.- Unpacking sequences doesn't require list brackets:-```python[x, y] = xs # unnecessaryx, y = xs # better```-- For string formatting, use `x % (y,)` rather than `x % y`, to avoidambiguity if `y` happens to be a tuple.