Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
4a26170b
Commit
4a26170b
authored
Dec 28, 2015
by
Dong-hee Na
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue #596 'slice is not subclassable'
fix issue #596 'slice is not subclassable'
parent
92666536
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
src/runtime/types.cpp
src/runtime/types.cpp
+1
-0
test/tests/builtin_type_not_subclassable.py
test/tests/builtin_type_not_subclassable.py
+3
-0
No files found.
src/runtime/types.cpp
View file @
4a26170b
...
@@ -4018,6 +4018,7 @@ void setupRuntime() {
...
@@ -4018,6 +4018,7 @@ void setupRuntime() {
slice_cls
->
giveAttr
(
"step"
,
new
BoxedMemberDescriptor
(
BoxedMemberDescriptor
::
OBJECT
,
offsetof
(
BoxedSlice
,
step
)));
slice_cls
->
giveAttr
(
"step"
,
new
BoxedMemberDescriptor
(
BoxedMemberDescriptor
::
OBJECT
,
offsetof
(
BoxedSlice
,
step
)));
slice_cls
->
freeze
();
slice_cls
->
freeze
();
slice_cls
->
tp_compare
=
(
cmpfunc
)
slice_compare
;
slice_cls
->
tp_compare
=
(
cmpfunc
)
slice_compare
;
slice_cls
->
tp_flags
&=
~
Py_TPFLAGS_BASETYPE
;
static
PyMappingMethods
attrwrapper_as_mapping
;
static
PyMappingMethods
attrwrapper_as_mapping
;
attrwrapper_cls
->
tp_as_mapping
=
&
attrwrapper_as_mapping
;
attrwrapper_cls
->
tp_as_mapping
=
&
attrwrapper_as_mapping
;
...
...
test/tests/builtin_type_not_subclassable.py
0 → 100644
View file @
4a26170b
# should_error
class
foo
(
slice
):
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