Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
aed19e49
Commit
aed19e49
authored
May 05, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test that side-effects of unused f-strings still apply.
parent
7ce18eb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
tests/run/fstring.pyx
tests/run/fstring.pyx
+21
-0
No files found.
tests/run/fstring.pyx
View file @
aed19e49
...
...
@@ -574,6 +574,27 @@ def percent_s_unicode(u, int i):
return
u"%s-%d"
%
(
u
,
i
)
@
cython
.
test_assert_path_exists
(
"//FormattedValueNode"
,
)
def
sideeffect
(
l
):
"""
>>> class Listish(list):
... def __format__(self, format_spec):
... self.append("format called")
... return repr(self)
... def append(self, item):
... list.append(self, item)
... return self
>>> l = Listish()
>>> sideeffect(l)
[123, 'format called']
"""
f"
{
l
.
append
(
123
)
}
"
# unused f-string !
return
list
(
l
)
########################################
# await inside f-string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment