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
8aa091c5
Commit
8aa091c5
authored
Dec 16, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let SliceNode know it returns a slice instance
parent
87fbdd72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
Cython/Compiler/Builtin.py
Cython/Compiler/Builtin.py
+2
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+6
-3
No files found.
Cython/Compiler/Builtin.py
View file @
8aa091c5
...
...
@@ -424,7 +424,7 @@ def init_builtins():
'__debug__'
,
PyrexTypes
.
c_const_type
(
PyrexTypes
.
c_bint_type
),
pos
=
None
,
cname
=
'(!Py_OptimizeFlag)'
,
is_cdef
=
True
)
global
list_type
,
tuple_type
,
dict_type
,
set_type
,
frozenset_type
global
bytes_type
,
str_type
,
unicode_type
,
basestring_type
global
bytes_type
,
str_type
,
unicode_type
,
basestring_type
,
slice_type
global
float_type
,
bool_type
,
type_type
,
complex_type
,
bytearray_type
type_type
=
builtin_scope
.
lookup
(
'type'
).
type
list_type
=
builtin_scope
.
lookup
(
'list'
).
type
...
...
@@ -432,6 +432,7 @@ def init_builtins():
dict_type
=
builtin_scope
.
lookup
(
'dict'
).
type
set_type
=
builtin_scope
.
lookup
(
'set'
).
type
frozenset_type
=
builtin_scope
.
lookup
(
'frozenset'
).
type
slice_type
=
builtin_scope
.
lookup
(
'slice'
).
type
bytes_type
=
builtin_scope
.
lookup
(
'bytes'
).
type
str_type
=
builtin_scope
.
lookup
(
'str'
).
type
unicode_type
=
builtin_scope
.
lookup
(
'unicode'
).
type
...
...
Cython/Compiler/ExprNodes.py
View file @
8aa091c5
...
...
@@ -11,7 +11,7 @@ cython.declare(error=object, warning=object, warn_once=object, InternalError=obj
unicode_type
=
object
,
str_type
=
object
,
bytes_type
=
object
,
type_type
=
object
,
Builtin
=
object
,
Symtab
=
object
,
Utils
=
object
,
find_coercion_error
=
object
,
debug_disposal_code
=
object
,
debug_temp_alloc
=
object
,
debug_coercion
=
object
,
bytearray_type
=
object
)
bytearray_type
=
object
,
slice_type
=
object
)
import
sys
import
copy
...
...
@@ -29,7 +29,7 @@ from PyrexTypes import py_object_type, c_long_type, typecast, error_type, \
unspecified_type
import
TypeSlots
from
Builtin
import
list_type
,
tuple_type
,
set_type
,
dict_type
,
type_type
,
\
unicode_type
,
str_type
,
bytes_type
,
bytearray_type
,
basestring_type
unicode_type
,
str_type
,
bytes_type
,
bytearray_type
,
basestring_type
,
slice_type
import
Builtin
import
Symtab
from
Cython
import
Utils
...
...
@@ -4114,7 +4114,7 @@ class SliceNode(ExprNode):
subexprs
=
[
'start'
,
'stop'
,
'step'
]
type
=
py_object
_type
type
=
slice
_type
is_temp
=
1
def
calculate_constant_result
(
self
):
...
...
@@ -4132,6 +4132,9 @@ class SliceNode(ExprNode):
except
Exception
,
e
:
self
.
compile_time_value_error
(
e
)
def
may_be_none
(
self
):
return
False
def
analyse_types
(
self
,
env
):
start
=
self
.
start
.
analyse_types
(
env
)
stop
=
self
.
stop
.
analyse_types
(
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