Author: Alex Gaynor <alex.gay...@gmail.com>
Branch: py3k
Changeset: r50820:fad1ecae7c0d
Date: 2011-12-21 21:35 -0600
http://bitbucket.org/pypy/pypy/changeset/fad1ecae7c0d/

Log:    simplify callable() code and fix a bug in it, None is not the same
        as false :)

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1012,10 +1012,7 @@
         return None
 
     def callable(self, w_obj):
-        if self.lookup(w_obj, "__call__") is not None:
-            return self.w_True
-        else:
-            return self.w_None
+        return self.wrap(self.lookup(w_obj, "__call__") is not None)
 
     def issequence_w(self, w_obj):
         return (self.findattr(w_obj, self.wrap("__getitem__")) is not None)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to