Skip to content

Commit

Permalink
Enable use of f-strings in Python 3.6. (python-attrs#858)
Browse files Browse the repository at this point in the history
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'
```
  • Loading branch information
thetorpedodog authored Nov 2, 2021
1 parent 82ab0c1 commit 5a368d8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/attr/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a368d8

Please sign in to comment.