[pypy-commit] pypy py3.6-asyncgen: Add space.callable_w() method
rlamy
pypy.commits at gmail.com
Wed Oct 2 15:52:29 EDT 2019
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.6-asyncgen
Changeset: r97712:4fb21ab8a5c6
Date: 2019-10-02 20:50 +0100
http://bitbucket.org/pypy/pypy/changeset/4fb21ab8a5c6/
Log: Add space.callable_w() method
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1232,8 +1232,11 @@
from pypy.interpreter.generator import GeneratorIterator
return isinstance(w_obj, GeneratorIterator)
+ def callable_w(self, w_obj):
+ return self.lookup(w_obj, "__call__") is not None
+
def callable(self, w_obj):
- return self.newbool(self.lookup(w_obj, "__call__") is not None)
+ return self.newbool(self.callable_w(w_obj))
def issequence_w(self, w_obj):
flag = self.type(w_obj).flag_map_or_seq
More information about the pypy-commit
mailing list