From 65499277016e77abb8bc520544b479549fd55f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 15 Sep 2018 10:07:13 +0300 Subject: [PATCH] Encourage new style string formatting (#87) --- docs/development_guidelines.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/development_guidelines.md b/docs/development_guidelines.md index 51207c4b..c5b06948 100644 --- a/docs/development_guidelines.md +++ b/docs/development_guidelines.md @@ -81,3 +81,12 @@ Instead of order the imports manually, use [`isort`](https://github.com/timothyc $ pip3 install isort $ isort homeassistant/components/sensor/fixer.py ``` + +### Use new style string formatting + +Prefer [new style string formatting](https://www.python.org/dev/peps/pep-3101/) over old. + +```python +"{} {}".format('New', 'style') +"%s %s" % ('Old', 'style') +```