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
Gwenaël Samain
cython
Commits
e23754c3
Commit
e23754c3
authored
Dec 16, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make CallNode a little smarter about when the return value can be None
parent
8aa091c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+8
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
e23754c3
...
@@ -4230,6 +4230,14 @@ class CallNode(ExprNode):
...
@@ -4230,6 +4230,14 @@ class CallNode(ExprNode):
def
may_be_none
(
self
):
def
may_be_none
(
self
):
if
self
.
may_return_none
is
not
None
:
if
self
.
may_return_none
is
not
None
:
return
self
.
may_return_none
return
self
.
may_return_none
func_type
=
self
.
function
.
type
if
func_type
is
type_type
and
self
.
function
.
is_name
:
entry
=
self
.
function
.
entry
if
entry
.
type
.
is_extension_type
:
return
False
if
(
entry
.
type
.
is_builtin_type
and
entry
.
name
in
Builtin
.
types_that_construct_their_instance
):
return
False
return
ExprNode
.
may_be_none
(
self
)
return
ExprNode
.
may_be_none
(
self
)
def
analyse_as_type_constructor
(
self
,
env
):
def
analyse_as_type_constructor
(
self
,
env
):
...
...
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