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
768b167d
Commit
768b167d
authored
Sep 28, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test after removing the 'u' prefix from unicode string annotation values.
parent
af1300f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
21 deletions
+18
-21
tests/run/cython3.pyx
tests/run/cython3.pyx
+18
-21
No files found.
tests/run/cython3.pyx
View file @
768b167d
...
...
@@ -7,25 +7,22 @@ print(end='') # test that language_level 3 applies immediately at the module st
cimport
cython
__doc__
=
"""
>>> items = sorted(locals_function(1).items())
>>> for item in items:
... print('%s = %r' % item)
a = 1
b = 2
x = u'abc'
>>> except_as_deletes
True
>>> no_match_does_not_touch_target
True
"""
import
sys
IS_PY2
=
sys
.
version_info
[
0
]
<
3
if
not
IS_PY2
:
__doc__
=
__doc__
.
replace
(
" u'"
,
" '"
)
def
locals_function
(
a
,
b
=
2
):
"""
>>> items = sorted(locals_function(1).items())
>>> for item in items:
... print('%s = %r' % item)
a = 1
b = 2
x = 'abc'
"""
x
=
'abc'
return
locals
()
...
...
@@ -352,7 +349,7 @@ def unicode_literals():
def
non_ascii_unprefixed_str
():
u
"""
"""
>>> s = non_ascii_unprefixed_str()
>>> isinstance(s, bytes)
False
...
...
@@ -365,7 +362,7 @@ def non_ascii_unprefixed_str():
def
non_ascii_raw_str
():
u
"""
"""
>>> s = non_ascii_raw_str()
>>> isinstance(s, bytes)
False
...
...
@@ -378,7 +375,7 @@ def non_ascii_raw_str():
def
non_ascii_raw_prefixed_unicode
():
u
"""
"""
>>> s = non_ascii_raw_prefixed_unicode()
>>> isinstance(s, bytes)
False
...
...
@@ -616,15 +613,15 @@ def annotation_syntax(a: "test new test", b : "other" = 2, *args: "ARGS", **kwar
>>> len(annotation_syntax.__annotations__)
5
>>> print(annotation_syntax.__annotations__['a'])
u
'test new test'
'test new test'
>>> print(annotation_syntax.__annotations__['b'])
u
'other'
'other'
>>> print(annotation_syntax.__annotations__['args'])
u
'ARGS'
'ARGS'
>>> print(annotation_syntax.__annotations__['kwargs'])
u
'KWARGS'
'KWARGS'
>>> print(annotation_syntax.__annotations__['return'])
u
'ret'
'ret'
"""
result
:
int
=
a
+
b
...
...
@@ -648,10 +645,10 @@ async def async_def_annotations(x: 'int') -> 'float':
>>> ret, arg = sorted(async_def_annotations.__annotations__.items())
>>> print(ret[0]); print(ret[1])
return
u
'float'
'float'
>>> print(arg[0]); print(arg[1])
x
u
'int'
'int'
"""
return
float
(
x
)
...
...
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