[Python-3000-checkins] r55486 - in python/branches/p3yk: Demo/pdist/RCSProxy.py Doc/lib/libfuncs.tex Doc/tut/tut.tex Lib/SimpleXMLRPCServer.py Lib/copy_reg.py Lib/distutils/dist.py Lib/encodings/__init__.py Lib/fileinput.py Lib/hmac.py Lib/idlelib/rpc.py Lib/imputil.py Lib/lib-tk/Tix.py Lib/lib-tk/Tkinter.py Lib/optparse.py Lib/pickle.py Lib/pydoc.py Lib/re.py Lib/test/test_binascii.py Lib/test/test_bool.py Lib/test/test_builtin.py Lib/test/test_codeop.py Lib/test/test_socket.py Lib/test/test_xml_etree.py Lib/test/test_xml_etree_c.py Lib/test/time_hashlib.py Lib/timeit.py Lib/unittest.py Misc/NEWS Python/bltinmodule.c
neal.norwitz
python-3000-checkins at python.org
Mon May 21 09:00:23 CEST 2007
Author: neal.norwitz
Date: Mon May 21 08:59:52 2007
New Revision: 55486
Modified:
python/branches/p3yk/Demo/pdist/RCSProxy.py
python/branches/p3yk/Doc/lib/libfuncs.tex
python/branches/p3yk/Doc/tut/tut.tex
python/branches/p3yk/Lib/SimpleXMLRPCServer.py
python/branches/p3yk/Lib/copy_reg.py
python/branches/p3yk/Lib/distutils/dist.py
python/branches/p3yk/Lib/encodings/__init__.py
python/branches/p3yk/Lib/fileinput.py
python/branches/p3yk/Lib/hmac.py
python/branches/p3yk/Lib/idlelib/rpc.py
python/branches/p3yk/Lib/imputil.py
python/branches/p3yk/Lib/lib-tk/Tix.py
python/branches/p3yk/Lib/lib-tk/Tkinter.py
python/branches/p3yk/Lib/optparse.py
python/branches/p3yk/Lib/pickle.py
python/branches/p3yk/Lib/pydoc.py
python/branches/p3yk/Lib/re.py
python/branches/p3yk/Lib/test/test_binascii.py
python/branches/p3yk/Lib/test/test_bool.py
python/branches/p3yk/Lib/test/test_builtin.py
python/branches/p3yk/Lib/test/test_codeop.py
python/branches/p3yk/Lib/test/test_socket.py
python/branches/p3yk/Lib/test/test_xml_etree.py
python/branches/p3yk/Lib/test/test_xml_etree_c.py
python/branches/p3yk/Lib/test/time_hashlib.py
python/branches/p3yk/Lib/timeit.py
python/branches/p3yk/Lib/unittest.py
python/branches/p3yk/Misc/NEWS
python/branches/p3yk/Python/bltinmodule.c
Log:
Remove callable() builtin
Modified: python/branches/p3yk/Demo/pdist/RCSProxy.py
==============================================================================
--- python/branches/p3yk/Demo/pdist/RCSProxy.py (original)
+++ python/branches/p3yk/Demo/pdist/RCSProxy.py Mon May 21 08:59:52 2007
@@ -185,7 +185,7 @@
what = sys.argv[1]
if hasattr(proxy, what):
attr = getattr(proxy, what)
- if callable(attr):
+ if hasattr(attr, '__call__'):
print attr(*sys.argv[2:])
else:
print repr(attr)
Modified: python/branches/p3yk/Doc/lib/libfuncs.tex
==============================================================================
--- python/branches/p3yk/Doc/lib/libfuncs.tex (original)
+++ python/branches/p3yk/Doc/lib/libfuncs.tex Mon May 21 08:59:52 2007
@@ -118,15 +118,6 @@
\constant{False}]{2.3}
\end{funcdesc}
-\begin{funcdesc}{callable}{object}
- Return true if the \var{object} argument appears callable, false if
- not. If this returns true, it is still possible that a call fails,
- but if it is false, calling \var{object} will never succeed. Note
- that classes are callable (calling a class returns a new instance);
- class instances are callable if they have a \method{__call__()}
- method.
-\end{funcdesc}
-
\begin{funcdesc}{chr}{i}
Return a string of one character whose \ASCII{} code is the integer
\var{i}. For example, \code{chr(97)} returns the string \code{'a'}.
Modified: python/branches/p3yk/Doc/tut/tut.tex
==============================================================================
--- python/branches/p3yk/Doc/tut/tut.tex (original)
+++ python/branches/p3yk/Doc/tut/tut.tex Mon May 21 08:59:52 2007
@@ -2696,9 +2696,9 @@
'UserWarning', 'ValueError', 'Warning', 'WindowsError',
'ZeroDivisionError', '_', '__debug__', '__doc__', '__import__',
'__name__', 'abs', 'basestring', 'bool', 'buffer',
- 'callable', 'chr', 'classmethod', 'cmp', 'compile',
+ 'chr', 'classmethod', 'cmp', 'compile',
'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod',
- 'enumerate', 'eval', 'exec', 'execfile', 'exit', 'file', 'filter', 'float',
+ 'enumerate', 'eval', 'execfile', 'exit', 'file', 'filter', 'float',
'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex',
'id', 'input', 'int', 'isinstance', 'issubclass', 'iter',
'len', 'license', 'list', 'locals', 'long', 'map', 'max', 'min',
Modified: python/branches/p3yk/Lib/SimpleXMLRPCServer.py
==============================================================================
--- python/branches/p3yk/Lib/SimpleXMLRPCServer.py (original)
+++ python/branches/p3yk/Lib/SimpleXMLRPCServer.py Mon May 21 08:59:52 2007
@@ -139,7 +139,7 @@
return [member for member in dir(obj)
if not member.startswith('_') and
- callable(getattr(obj, member))]
+ hasattr(getattr(obj, member), '__call__')]
def remove_duplicates(lst):
"""remove_duplicates([2,2,2,1,3,3]) => [3,1,2]
Modified: python/branches/p3yk/Lib/copy_reg.py
==============================================================================
--- python/branches/p3yk/Lib/copy_reg.py (original)
+++ python/branches/p3yk/Lib/copy_reg.py Mon May 21 08:59:52 2007
@@ -10,7 +10,7 @@
dispatch_table = {}
def pickle(ob_type, pickle_function, constructor_ob=None):
- if not callable(pickle_function):
+ if not hasattr(pickle_function, '__call__'):
raise TypeError("reduction functions must be callable")
dispatch_table[ob_type] = pickle_function
@@ -20,7 +20,7 @@
constructor(constructor_ob)
def constructor(object):
- if not callable(object):
+ if not hasattr(object, '__call__'):
raise TypeError("constructors must be callable")
# Example: provide pickling support for complex numbers.
Modified: python/branches/p3yk/Lib/distutils/dist.py
==============================================================================
--- python/branches/p3yk/Lib/distutils/dist.py (original)
+++ python/branches/p3yk/Lib/distutils/dist.py Mon May 21 08:59:52 2007
@@ -569,7 +569,7 @@
#print "showing help for option %s of command %s" % \
# (help_option[0],cmd_class)
- if callable(func):
+ if hasattr(func, '__call__'):
func()
else:
raise DistutilsClassError(
Modified: python/branches/p3yk/Lib/encodings/__init__.py
==============================================================================
--- python/branches/p3yk/Lib/encodings/__init__.py (original)
+++ python/branches/p3yk/Lib/encodings/__init__.py Mon May 21 08:59:52 2007
@@ -122,12 +122,12 @@
raise CodecRegistryError,\
'module "%s" (%s) failed to register' % \
(mod.__name__, mod.__file__)
- if not callable(entry[0]) or \
- not callable(entry[1]) or \
- (entry[2] is not None and not callable(entry[2])) or \
- (entry[3] is not None and not callable(entry[3])) or \
- (len(entry) > 4 and entry[4] is not None and not callable(entry[4])) or \
- (len(entry) > 5 and entry[5] is not None and not callable(entry[5])):
+ if not hasattr(entry[0], '__call__') or \
+ not hasattr(entry[1], '__call__') or \
+ (entry[2] is not None and not hasattr(entry[2], '__call__')) or \
+ (entry[3] is not None and not hasattr(entry[3], '__call__')) or \
+ (len(entry) > 4 and entry[4] is not None and not hasattr(entry[4], '__call__')) or \
+ (len(entry) > 5 and entry[5] is not None and not hasattr(entry[5], '__call__')):
raise CodecRegistryError,\
'incompatible codecs in module "%s" (%s)' % \
(mod.__name__, mod.__file__)
Modified: python/branches/p3yk/Lib/fileinput.py
==============================================================================
--- python/branches/p3yk/Lib/fileinput.py (original)
+++ python/branches/p3yk/Lib/fileinput.py Mon May 21 08:59:52 2007
@@ -226,7 +226,7 @@
self._mode = mode
if inplace and openhook:
raise ValueError("FileInput cannot use an opening hook in inplace mode")
- elif openhook and not callable(openhook):
+ elif openhook and not hasattr(openhook, '__call__'):
raise ValueError("FileInput openhook must be callable")
self._openhook = openhook
Modified: python/branches/p3yk/Lib/hmac.py
==============================================================================
--- python/branches/p3yk/Lib/hmac.py (original)
+++ python/branches/p3yk/Lib/hmac.py Mon May 21 08:59:52 2007
@@ -39,7 +39,7 @@
import hashlib
digestmod = hashlib.md5
- if callable(digestmod):
+ if hasattr(digestmod, '__call__'):
self.digest_cons = digestmod
else:
self.digest_cons = lambda d='': digestmod.new(d)
Modified: python/branches/p3yk/Lib/idlelib/rpc.py
==============================================================================
--- python/branches/p3yk/Lib/idlelib/rpc.py (original)
+++ python/branches/p3yk/Lib/idlelib/rpc.py Mon May 21 08:59:52 2007
@@ -572,7 +572,7 @@
# Adds names to dictionary argument 'methods'
for name in dir(obj):
attr = getattr(obj, name)
- if callable(attr):
+ if hasattr(attr, '__call__'):
methods[name] = 1
if type(obj) == types.ClassType:
for super in obj.__bases__:
@@ -581,7 +581,7 @@
def _getattributes(obj, attributes):
for name in dir(obj):
attr = getattr(obj, name)
- if not callable(attr):
+ if not hasattr(attr, '__call__'):
attributes[name] = 1
class MethodProxy(object):
Modified: python/branches/p3yk/Lib/imputil.py
==============================================================================
--- python/branches/p3yk/Lib/imputil.py (original)
+++ python/branches/p3yk/Lib/imputil.py Mon May 21 08:59:52 2007
@@ -48,7 +48,7 @@
self.namespace['__import__'] = self.previous_importer
def add_suffix(self, suffix, importFunc):
- assert callable(importFunc)
+ assert hasattr(importFunc, '__call__')
self.fs_imp.add_suffix(suffix, importFunc)
######################################################################
@@ -539,7 +539,7 @@
self.suffixes = [ ]
def add_suffix(self, suffix, importFunc):
- assert callable(importFunc)
+ assert hasattr(importFunc, '__call__')
self.suffixes.append((suffix, importFunc))
def import_from_dir(self, dir, fqname):
Modified: python/branches/p3yk/Lib/lib-tk/Tix.py
==============================================================================
--- python/branches/p3yk/Lib/lib-tk/Tix.py (original)
+++ python/branches/p3yk/Lib/lib-tk/Tix.py Mon May 21 08:59:52 2007
@@ -390,7 +390,7 @@
elif kw: cnf = kw
options = ()
for k, v in cnf.items():
- if callable(v):
+ if hasattr(v, '__call__'):
v = self._register(v)
options = options + ('-'+k, v)
return master.tk.call(('image', 'create', imgtype,) + options)
Modified: python/branches/p3yk/Lib/lib-tk/Tkinter.py
==============================================================================
--- python/branches/p3yk/Lib/lib-tk/Tkinter.py (original)
+++ python/branches/p3yk/Lib/lib-tk/Tkinter.py Mon May 21 08:59:52 2007
@@ -1053,7 +1053,7 @@
for k, v in cnf.items():
if v is not None:
if k[-1] == '_': k = k[:-1]
- if callable(v):
+ if hasattr(v, '__call__'):
v = self._register(v)
res = res + ('-'+k, v)
return res
@@ -1570,7 +1570,7 @@
"""Bind function FUNC to command NAME for this widget.
Return the function bound to NAME if None is given. NAME could be
e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW"."""
- if callable(func):
+ if hasattr(func, '__call__'):
command = self._register(func)
else:
command = func
@@ -3221,7 +3221,7 @@
elif kw: cnf = kw
options = ()
for k, v in cnf.items():
- if callable(v):
+ if hasattr(v, '__call__'):
v = self._register(v)
options = options + ('-'+k, v)
self.tk.call(('image', 'create', imgtype, name,) + options)
@@ -3244,7 +3244,7 @@
for k, v in _cnfmerge(kw).items():
if v is not None:
if k[-1] == '_': k = k[:-1]
- if callable(v):
+ if hasattr(v, '__call__'):
v = self._register(v)
res = res + ('-'+k, v)
self.tk.call((self.name, 'config') + res)
Modified: python/branches/p3yk/Lib/optparse.py
==============================================================================
--- python/branches/p3yk/Lib/optparse.py (original)
+++ python/branches/p3yk/Lib/optparse.py Mon May 21 08:59:52 2007
@@ -700,7 +700,7 @@
def _check_callback(self):
if self.action == "callback":
- if not callable(self.callback):
+ if not hasattr(self.callback, '__call__'):
raise OptionError(
"callback not callable: %r" % self.callback, self)
if (self.callback_args is not None and
Modified: python/branches/p3yk/Lib/pickle.py
==============================================================================
--- python/branches/p3yk/Lib/pickle.py (original)
+++ python/branches/p3yk/Lib/pickle.py Mon May 21 08:59:52 2007
@@ -350,7 +350,7 @@
raise PicklingError("args from reduce() should be a tuple")
# Assert that func is callable
- if not callable(func):
+ if not hasattr(func, '__call__'):
raise PicklingError("func from reduce should be callable")
save = self.save
Modified: python/branches/p3yk/Lib/pydoc.py
==============================================================================
--- python/branches/p3yk/Lib/pydoc.py (original)
+++ python/branches/p3yk/Lib/pydoc.py Mon May 21 08:59:52 2007
@@ -754,7 +754,7 @@
push(msg)
for name, kind, homecls, value in ok:
base = self.docother(getattr(object, name), name, mod)
- if callable(value) or inspect.isdatadescriptor(value):
+ if hasattr(value, '__call__') or inspect.isdatadescriptor(value):
doc = getattr(value, "__doc__", None)
else:
doc = None
@@ -1169,7 +1169,7 @@
hr.maybe()
push(msg)
for name, kind, homecls, value in ok:
- if callable(value) or inspect.isdatadescriptor(value):
+ if hasattr(value, '__call__') or inspect.isdatadescriptor(value):
doc = getdoc(value)
else:
doc = None
Modified: python/branches/p3yk/Lib/re.py
==============================================================================
--- python/branches/p3yk/Lib/re.py (original)
+++ python/branches/p3yk/Lib/re.py Mon May 21 08:59:52 2007
@@ -306,7 +306,7 @@
if i == j:
break
action = self.lexicon[m.lastindex-1][1]
- if callable(action):
+ if hasattr(action, '__call__'):
self.match = m
action = action(self, m.group())
if action is not None:
Modified: python/branches/p3yk/Lib/test/test_binascii.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_binascii.py (original)
+++ python/branches/p3yk/Lib/test/test_binascii.py Mon May 21 08:59:52 2007
@@ -26,10 +26,10 @@
prefixes.extend(["crc_", "rlecode_", "rledecode_"])
for prefix in prefixes:
name = prefix + suffix
- self.assert_(callable(getattr(binascii, name)))
+ self.assert_(hasattr(getattr(binascii, name), '__call__'))
self.assertRaises(TypeError, getattr(binascii, name))
for name in ("hexlify", "unhexlify"):
- self.assert_(callable(getattr(binascii, name)))
+ self.assert_(hasattr(getattr(binascii, name), '__call__'))
self.assertRaises(TypeError, getattr(binascii, name))
def test_base64valid(self):
Modified: python/branches/p3yk/Lib/test/test_bool.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_bool.py (original)
+++ python/branches/p3yk/Lib/test/test_bool.py Mon May 21 08:59:52 2007
@@ -168,8 +168,8 @@
self.assertIs(hasattr([], "wobble"), False)
def test_callable(self):
- self.assertIs(callable(len), True)
- self.assertIs(callable(1), False)
+ self.assertIs(hasattr(len, '__call__'), True)
+ self.assertIs(hasattr(1, '__call__'), False)
def test_isinstance(self):
self.assertIs(isinstance(True, bool), True)
Modified: python/branches/p3yk/Lib/test/test_builtin.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_builtin.py (original)
+++ python/branches/p3yk/Lib/test/test_builtin.py Mon May 21 08:59:52 2007
@@ -164,20 +164,21 @@
self.assert_(isinstance(x, int))
self.assertEqual(-x, sys.maxint+1)
+ # XXX(nnorwitz): This test case for callable should probably be removed.
def test_callable(self):
- self.assert_(callable(len))
+ self.assert_(hasattr(len, '__call__'))
def f(): pass
- self.assert_(callable(f))
+ self.assert_(hasattr(f, '__call__'))
class C:
def meth(self): pass
- self.assert_(callable(C))
+ self.assert_(hasattr(C, '__call__'))
x = C()
- self.assert_(callable(x.meth))
- self.assert_(not callable(x))
+ self.assert_(hasattr(x.meth, '__call__'))
+ self.assert_(not hasattr(x, '__call__'))
class D(C):
def __call__(self): pass
y = D()
- self.assert_(callable(y))
+ self.assert_(hasattr(y, '__call__'))
y()
def test_chr(self):
Modified: python/branches/p3yk/Lib/test/test_codeop.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_codeop.py (original)
+++ python/branches/p3yk/Lib/test/test_codeop.py Mon May 21 08:59:52 2007
@@ -13,8 +13,8 @@
def unify_callables(d):
for n,v in d.items():
- if callable(v):
- d[n] = callable
+ if hasattr(v, '__call__'):
+ d[n] = True
return d
class CodeopTests(unittest.TestCase):
Modified: python/branches/p3yk/Lib/test/test_socket.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_socket.py (original)
+++ python/branches/p3yk/Lib/test/test_socket.py Mon May 21 08:59:52 2007
@@ -125,7 +125,7 @@
self.server_ready.wait()
self.client_ready.set()
self.clientSetUp()
- if not callable(test_func):
+ if not hasattr(test_func, '__call__'):
raise TypeError, "test_func must be a callable function"
try:
test_func()
Modified: python/branches/p3yk/Lib/test/test_xml_etree.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_xml_etree.py (original)
+++ python/branches/p3yk/Lib/test/test_xml_etree.py Mon May 21 08:59:52 2007
@@ -36,7 +36,7 @@
"""
def check_method(method):
- if not callable(method):
+ if not hasattr(method, '__call__'):
print(method, "not callable")
def serialize(ET, elem, encoding=None):
Modified: python/branches/p3yk/Lib/test/test_xml_etree_c.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_xml_etree_c.py (original)
+++ python/branches/p3yk/Lib/test/test_xml_etree_c.py Mon May 21 08:59:52 2007
@@ -34,7 +34,7 @@
"""
def check_method(method):
- if not callable(method):
+ if not hasattr(method, '__call__'):
print(method, "not callable")
def serialize(ET, elem, encoding=None):
Modified: python/branches/p3yk/Lib/test/time_hashlib.py
==============================================================================
--- python/branches/p3yk/Lib/test/time_hashlib.py (original)
+++ python/branches/p3yk/Lib/test/time_hashlib.py Mon May 21 08:59:52 2007
@@ -55,7 +55,7 @@
import _hashlib
exec('creatorFunc = lambda x=_hashlib.new : x(%r)' % sys.argv[2])
print("testing speed of _hashlib.new(%r)" % sys.argv[2])
-elif hasattr(hashlib, hName) and callable(getattr(hashlib, hName)):
+elif hasattr(hashlib, hName) and hasattr(getattr(hashlib, hName), '__call__'):
creatorFunc = getattr(hashlib, hName)
print("testing speed of hashlib."+hName, getattr(hashlib, hName))
else:
Modified: python/branches/p3yk/Lib/timeit.py
==============================================================================
--- python/branches/p3yk/Lib/timeit.py (original)
+++ python/branches/p3yk/Lib/timeit.py Mon May 21 08:59:52 2007
@@ -126,7 +126,7 @@
if isinstance(setup, basestring):
setup = reindent(setup, 4)
src = template % {'stmt': stmt, 'setup': setup}
- elif callable(setup):
+ elif hasattr(setup, '__call__'):
src = template % {'stmt': stmt, 'setup': '_setup()'}
ns['_setup'] = setup
else:
@@ -135,13 +135,13 @@
code = compile(src, dummy_src_name, "exec")
exec(code, globals(), ns)
self.inner = ns["inner"]
- elif callable(stmt):
+ elif hasattr(stmt, '__call__'):
self.src = None
if isinstance(setup, basestring):
_setup = setup
def setup():
exec(_setup, globals(), ns)
- elif not callable(setup):
+ elif not hasattr(setup, '__call__'):
raise ValueError("setup is neither a string nor callable")
self.inner = _template_func(setup, stmt)
else:
Modified: python/branches/p3yk/Lib/unittest.py
==============================================================================
--- python/branches/p3yk/Lib/unittest.py (original)
+++ python/branches/p3yk/Lib/unittest.py Mon May 21 08:59:52 2007
@@ -426,7 +426,7 @@
def addTest(self, test):
# sanity checks
- if not callable(test):
+ if not hasattr(test, '__call__'):
raise TypeError("the test to add must be callable")
if (isinstance(test, (type, types.ClassType)) and
issubclass(test, (TestCase, TestSuite))):
@@ -581,7 +581,7 @@
return TestSuite([parent(obj.__name__)])
elif isinstance(obj, TestSuite):
return obj
- elif callable(obj):
+ elif hasattr(obj, '__call__'):
test = obj()
if isinstance(test, TestSuite):
return test
@@ -604,7 +604,7 @@
"""Return a sorted sequence of method names found within testCaseClass
"""
def isTestMethod(attrname, testCaseClass=testCaseClass, prefix=self.testMethodPrefix):
- return attrname.startswith(prefix) and callable(getattr(testCaseClass, attrname))
+ return attrname.startswith(prefix) and hasattr(getattr(testCaseClass, attrname), '__call__')
testFnNames = filter(isTestMethod, dir(testCaseClass))
if self.sortTestMethodsUsing:
testFnNames.sort(self.sortTestMethodsUsing)
Modified: python/branches/p3yk/Misc/NEWS
==============================================================================
--- python/branches/p3yk/Misc/NEWS (original)
+++ python/branches/p3yk/Misc/NEWS Mon May 21 08:59:52 2007
@@ -28,8 +28,6 @@
- Remove BaseException.message.
-- Remove strop module.
-
- Remove tuple parameter unpacking (PEP 3113).
- Remove the f_restricted attribute from frames. This naturally leads to teh
@@ -41,8 +39,6 @@
- range() now returns an iterator rather than a list. Floats are not allowed.
xrange() is no longer defined.
-- Merged from (2.6) trunk at r54987.
-
- Patch #1660500: hide iteration variable in list comps, add set comps
and use common code to handle compilation of iterative expressions
@@ -66,8 +62,6 @@
- Removed indexing/slicing on BaseException.
-- Removed the exceptions module, all the exceptions are already builtin.
-
- input() became raw_input(): the name input() now implements the
functionality formerly known as raw_input(); the name raw_input()
is no longer defined.
@@ -138,36 +132,19 @@
- Absolute import is the default behavior for 'import foo' etc.
- Removed support for syntax:
- backticks (`x`), <>
+ backticks (ie, `x`), <>
- Removed these Python builtins:
- apply(), coerce()
+ apply(), callable(), coerce(), file()
- Removed these Python methods:
{}.has_key
-- Removed these Python slots:
- __coerce__, __div__, __idiv__, __rdiv__
-
-- Removed these attributes from Python modules:
- * operator module: div, idiv, __div__, __idiv__
-
-- Removed these C APIs:
- PyNumber_Coerce(), PyNumber_CoerceEx()
-
-- Removed these C slots/fields:
- nb_divide, nb_inplace_divide
-
-- Removed these macros:
- staticforward, statichere, PyArg_GetInt, PyArg_NoArgs
-
-- Removed these typedefs:
- intargfunc, intintargfunc, intobjargproc, intintobjargproc,
- getreadbufferproc, getwritebufferproc, getsegcountproc, getcharbufferproc
-
- Removed these opcodes:
BINARY_DIVIDE, INPLACE_DIVIDE, UNARY_CONVERT
+- Remove C API support for restricted execution.
+
- zip returns an iterator
- Additions:
@@ -175,40 +152,35 @@
- Added class decorators per PEP 3129.
+
Extension Modules
-----------------
- Remove the imageop module. Obsolete long with its unit tests becoming
useless from the removal of rgbimg and imgfile.
-- isCallable() and sequenceIncludes() have been removed from the operator
- module.
+- Removed these attributes from Python modules:
+ * operator module: div, idiv, __div__, __idiv__, isCallable, sequenceIncludes
Library
-------
-- Remove popen2 module and os.popen* functions.
-
- Remove the compiler package. Use of the _ast module and (an eventual)
AST -> bytecode mechanism.
-- Remove md5 and sha. Both have been deprecated since Python 2.5.
-
-- Remove Bastion and rexec as they have been disabled since Python 2.3 (this
- also leads to the C API support for restricted execution).
+- Removed these modules:
+ * Bastion, bsddb185, exceptions, md5, popen2, rexec,
+ sets, sha, stringold, strop, xmllib
- Remove obsolete IRIX modules: al/AL, cd/CD, cddb, cdplayer, cl/CL, DEVICE,
ERRNO, FILE, fl/FL, flp, fm, GET, gl/GL, GLWS, IN, imgfile, IOCTL, jpeg,
panel, panelparser, readcd, sgi, sv/SV, torgb, WAIT.
-- Remove bsddb185 module; it was obsolete.
+- Remove obsolete functions:
+ * commands.getstatus(), os.popen*,
-- Remove commands.getstatus(); it was obsolete.
-
-- Remove functions in string and strop modules that are also string methods.
-
-- Remove obsolete modules: xmllib, stringold.
+- Remove functions in the string module that are also string methods.
- Remove support for long obsolete platforms: plat-aix3, plat-irix5.
@@ -216,7 +188,6 @@
- Patch #1680961: atexit has been reimplemented in C.
-- Removed all traces of the sets module.
Build
-----
@@ -224,6 +195,23 @@
C API
-----
+- Removed these Python slots:
+ __coerce__, __div__, __idiv__, __rdiv__
+
+- Removed these C APIs:
+ PyNumber_Coerce(), PyNumber_CoerceEx()
+
+- Removed these C slots/fields:
+ nb_divide, nb_inplace_divide
+
+- Removed these macros:
+ staticforward, statichere, PyArg_GetInt, PyArg_NoArgs
+
+- Removed these typedefs:
+ intargfunc, intintargfunc, intobjargproc, intintobjargproc,
+ getreadbufferproc, getwritebufferproc, getsegcountproc, getcharbufferproc
+
+
Tests
-----
Modified: python/branches/p3yk/Python/bltinmodule.c
==============================================================================
--- python/branches/p3yk/Python/bltinmodule.c (original)
+++ python/branches/p3yk/Python/bltinmodule.c Mon May 21 08:59:52 2007
@@ -247,19 +247,6 @@
static PyObject *
-builtin_callable(PyObject *self, PyObject *v)
-{
- return PyBool_FromLong((long)PyCallable_Check(v));
-}
-
-PyDoc_STRVAR(callable_doc,
-"callable(object) -> bool\n\
-\n\
-Return whether the object is callable (i.e., some kind of function).\n\
-Note that classes are callable, as are instances with a __call__() method.");
-
-
-static PyObject *
builtin_filter(PyObject *self, PyObject *args)
{
PyObject *func, *seq, *result, *it, *arg;
@@ -1973,7 +1960,6 @@
{"abs", builtin_abs, METH_O, abs_doc},
{"all", builtin_all, METH_O, all_doc},
{"any", builtin_any, METH_O, any_doc},
- {"callable", builtin_callable, METH_O, callable_doc},
{"chr", builtin_chr, METH_VARARGS, chr_doc},
{"cmp", builtin_cmp, METH_VARARGS, cmp_doc},
{"compile", (PyCFunction)builtin_compile, METH_VARARGS | METH_KEYWORDS, compile_doc},
More information about the Python-3000-checkins
mailing list