Skip to content

Commit 5a368d8

Browse files
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' ```
1 parent 82ab0c1 commit 5a368d8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/attr/_compat.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88

99
PY2 = sys.version_info[0] == 2
1010
PYPY = platform.python_implementation() == "PyPy"
11-
HAS_F_STRINGS = (
12-
sys.version_info[:2] >= (3, 7)
13-
if not PYPY
14-
else sys.version_info[:2] >= (3, 6)
15-
)
11+
PY36 = sys.version_info[:2] >= (3, 6)
12+
HAS_F_STRINGS = PY36
1613
PY310 = sys.version_info[:2] >= (3, 10)
1714

1815

19-
if PYPY or sys.version_info[:2] >= (3, 6):
16+
if PYPY or PY36:
2017
ordered_dict = dict
2118
else:
2219
from collections import OrderedDict

0 commit comments

Comments
 (0)