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
e17f1272
Commit
e17f1272
authored
Nov 10, 2016
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
type_cls freeze should put behind all tp slots
parent
dd0c2f1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/runtime/types.cpp
src/runtime/types.cpp
+7
-6
No files found.
src/runtime/types.cpp
View file @
e17f1272
...
...
@@ -4523,9 +4523,9 @@ void setupRuntime() {
SET
=
typeFromClass
(
set_cls
);
FROZENSET
=
typeFromClass
(
frozenset_cls
);
object_cls
->
giveAttr
(
"__repr__"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
object_repr
,
UNKNOWN
,
1
,
false
,
false
,
"object.__repr__"
,
""
,
ParamNames
::
empty
(),
CAPI
)));
//
object_cls->giveAttr("__repr__",
//
new BoxedFunction(BoxedCode::create((void*)object_repr, UNKNOWN, 1, false, false,
//
"object.__repr__", "", ParamNames::empty(), CAPI)));
object_cls
->
giveAttr
(
"__subclasshook__"
,
boxInstanceMethod
(
object_cls
,
autoDecref
(
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
objectSubclasshook
,
UNKNOWN
,
...
...
@@ -4556,7 +4556,7 @@ void setupRuntime() {
type_cls
->
giveAttr
(
"__new__"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
typeNewGeneric
,
UNKNOWN
,
4
,
false
,
false
,
"type.__new__"
),
{
NULL
,
NULL
}));
type_cls
->
giveAttr
(
"__repr__"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
typeRepr
,
STR
,
1
,
"type.__repr__"
)));
//
type_cls->giveAttr("__repr__", new BoxedFunction(BoxedCode::create((void*)typeRepr, STR, 1, "type.__repr__")));
type_cls
->
tp_hash
=
(
hashfunc
)
_Py_HashPointer
;
type_cls
->
giveAttrDescriptor
(
"__module__"
,
type_module
,
type_set_module
);
type_cls
->
giveAttrMember
(
"__mro__"
,
T_OBJECT
,
offsetof
(
BoxedClass
,
tp_mro
));
...
...
@@ -4567,11 +4567,11 @@ void setupRuntime() {
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
typeSubclasses
,
UNKNOWN
,
1
,
"type.__subclasses__"
)));
type_cls
->
giveAttr
(
"mro"
,
new
BoxedFunction
(
BoxedCode
::
create
((
void
*
)
typeMro
,
UNKNOWN
,
1
,
"type.mro"
)));
type_cls
->
tp_richcompare
=
type_richcompare
;
add_operators
(
type_cls
);
type_cls
->
freeze
();
type_cls
->
tp_new
=
type_new
;
type_cls
->
tp_repr
=
type_repr
;
add_operators
(
type_cls
);
type_cls
->
freeze
();
type_cls
->
tpp_call
.
capi_val
=
&
typeTppCall
<
CAPI
>
;
type_cls
->
tpp_call
.
cxx_val
=
&
typeTppCall
<
CXX
>
;
...
...
@@ -4602,6 +4602,7 @@ void setupRuntime() {
object_cls
->
giveAttrDescriptor
(
"__class__"
,
object_get_class
,
object_set_class
);
object_cls
->
tp_str
=
object_str
;
// object_cls->tp_repr = object_str;
add_operators
(
object_cls
);
object_cls
->
freeze
();
...
...
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