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
94687bdb
Commit
94687bdb
authored
Jul 09, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #682 from kmod/instancemethod_getattr_fix
Fix irgen bug for instancemethods
parents
f7546648
3fb60317
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
src/runtime/types.h
src/runtime/types.h
+11
-1
test/tests/instance_methods.py
test/tests/instance_methods.py
+6
-0
No files found.
src/runtime/types.h
View file @
94687bdb
...
...
@@ -206,7 +206,17 @@ public:
const
std
::
vector
<
BoxedString
*>*
);
pyston_call
tpp_call
;
bool
hasGenericGetattr
()
{
return
tp_getattr
==
NULL
;
}
bool
hasGenericGetattr
()
{
if
(
tp_getattr
)
return
false
;
// instancemethod_cls should have a custom tp_getattr but is currently implemented
// as a hack within getattrInternalGeneric
if
(
this
==
instancemethod_cls
)
return
false
;
return
true
;
}
void
freeze
();
...
...
test/tests/instance_methods.py
View file @
94687bdb
...
...
@@ -37,3 +37,9 @@ print type(C().foo.im_func), type(C().foo.__func__)
print
type
(
C
().
foo
.
im_self
),
type
(
C
().
foo
.
__self__
)
print
type
(
C
().
foo
.
im_class
)
print
repr
(
C
().
foo
)
def
f
(
m
):
print
m
.
__name__
f
(
C
.
foo
)
f
(
C
().
foo
)
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