From 5a368d82997570bdad2ba371e897cc777809461f Mon Sep 17 00:00:00 2001 From: paul fisher Date: Tue, 2 Nov 2021 03:04:26 -0400 Subject: [PATCH] Enable use of f-strings in Python 3.6. (#858) CPython 3.6 has f-strings: ``` Python 3.6.13 |Anaconda, Inc.| (default, Jun 4 2021, 14:25:59) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> f"hello" 'hello' ``` --- src/attr/_compat.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/attr/_compat.py b/src/attr/_compat.py index 69329e996..cc20246cb 100644 --- a/src/attr/_compat.py +++ b/src/attr/_compat.py @@ -8,15 +8,12 @@ PY2 = sys.version_info[0] == 2 PYPY = platform.python_implementation() == "PyPy" -HAS_F_STRINGS = ( - sys.version_info[:2] >= (3, 7) - if not PYPY - else sys.version_info[:2] >= (3, 6) -) +PY36 = sys.version_info[:2] >= (3, 6) +HAS_F_STRINGS = PY36 PY310 = sys.version_info[:2] >= (3, 10) -if PYPY or sys.version_info[:2] >= (3, 6): +if PYPY or PY36: ordered_dict = dict else: from collections import OrderedDict