Skip to content

Commit

Permalink
Enable use of f-strings in Python 3.6.
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 committed Nov 1, 2021
1 parent 82ab0c1 commit f9bec9e
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 f9bec9e

Please sign in to comment.