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
c36aa2f8
Commit
c36aa2f8
authored
Dec 25, 2021
by
Corentin Cadiou
Committed by
GitHub
Dec 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow default value for memory view (GH-4315)
Closes
https://github.com/cython/cython/issues/4313
parent
9b25e0d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-0
tests/run/cyfunction_defaults.pyx
tests/run/cyfunction_defaults.pyx
+11
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
c36aa2f8
...
...
@@ -13192,6 +13192,9 @@ class CoercionNode(ExprNode):
code
.
annotate
((
file
,
line
,
col
-
1
),
AnnotationItem
(
style
=
'coerce'
,
tag
=
'coerce'
,
text
=
'[%s] to [%s]'
%
(
self
.
arg
.
type
,
self
.
type
)))
def
analyse_types
(
self
,
env
):
return
self
class
CoerceToMemViewSliceNode
(
CoercionNode
):
"""
...
...
tests/run/cyfunction_defaults.pyx
View file @
c36aa2f8
...
...
@@ -308,6 +308,10 @@ cdef class C:
pass
cpdef
f8
(
self
,
a
,
list
s
=
[
15
]):
pass
cpdef
f9
(
self
,
a
,
int
[:]
s
=
None
):
pass
def
f10
(
self
,
a
,
/
,
b
=
1
,
*
,
int
[:]
c
=
None
):
pass
def
check_defaults_on_methods_for_introspection
():
...
...
@@ -336,5 +340,12 @@ def check_defaults_on_methods_for_introspection():
>>> C.f8.__defaults__
([15],)
>>> C.f8.__kwdefaults__
>>> C.f9.__defaults__
(None,)
>>> C.f9.__kwdefaults__
>>> C.f10.__defaults__
(1,)
>>> C.f10.__kwdefaults__
{'c': None}
"""
pass
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