Support 3.12 feature: PEP 701 – Syntactic formalization of f-strings
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
The following valid Python samples from https://peps.python.org/pep-0701/ running under 3.12.0rc1 will cause exceptions in YAPF.
1.
```python
bag = {'wand': 'Elder'}
print(f'Magic wand: { bag['wand'] }')
```
1.
```python
source = 'a_file.py'
print(f"{source.removesuffix(".py")}.c: $(srcdir)/{source}")
```
1.
```python
print(f"{f"{f"{f"{f"{f"{1+1}"}"}"}"}"}")
```
1.
```python
print(f"{'':*^{1:{1:{1}}}}")
```
1.
```python
x = 1
y = 2
print(
f"___{
x
}___"
)
print(
f"___{(
y
)}___"
)
```
1.
```python
my_dict = {"key": "value"}
print(f" something { my_dict["key"] } something else ")
```
Contributor guide
Assessment
This issue has not been assessed yet.