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
ee9a0730
Commit
ee9a0730
authored
Oct 22, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ticket #215, explicit error for __getslice__, __delslice__ in Py3.
parent
d2c94b6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+4
-1
No files found.
Cython/Compiler/ModuleNode.py
View file @
ee9a0730
...
...
@@ -870,7 +870,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
scope
.
defines_any
([
"__setitem__"
,
"__delitem__"
]):
self
.
generate_ass_subscript_function
(
scope
,
code
)
if
scope
.
defines_any
([
"__setslice__"
,
"__delslice__"
]):
warning
(
self
.
pos
,
"__setslice__ and __delslice__ are not supported by Python 3"
,
1
)
warning
(
self
.
pos
,
"__setslice__ and __delslice__ are not supported by Python 3
, use __setitem__ and __getitem__ instead
"
,
1
)
self
.
generate_ass_slice_function
(
scope
,
code
)
if
scope
.
defines_any
([
"__getattr__"
,
"__getattribute__"
]):
self
.
generate_getattro_function
(
scope
,
code
)
...
...
@@ -1197,6 +1197,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# Setting and deleting a slice are both done through
# the ass_slice method, so we dispatch to user's __setslice__
# or __delslice__, or raise an exception.
code
.
putln
(
"#if PY_MAJOR_VERSION >= 3"
)
code
.
putln
(
"#error __setslice__ and __delslice__ not supported in Python 3."
)
code
.
putln
(
"#endif"
)
base_type
=
scope
.
parent_type
.
base_type
set_entry
=
scope
.
lookup_here
(
"__setslice__"
)
del_entry
=
scope
.
lookup_here
(
"__delslice__"
)
...
...
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