[pypy-commit] pypy py3k: (buchuki) remove apply
gutworth
noreply at buildbot.pypy.org
Mon Mar 12 21:47:21 CET 2012
Author: Benjamin Peterson <benjamin at python.org>
Branch: py3k
Changeset: r53341:440690fb6584
Date: 2012-03-12 13:39 -0700
http://bitbucket.org/pypy/pypy/changeset/440690fb6584/
Log: (buchuki) remove apply
diff --git a/pypy/module/__builtin__/__init__.py b/pypy/module/__builtin__/__init__.py
--- a/pypy/module/__builtin__/__init__.py
+++ b/pypy/module/__builtin__/__init__.py
@@ -15,7 +15,6 @@
'input' : 'app_io.input',
'print' : 'app_io.print_',
- 'apply' : 'app_functional.apply',
'sorted' : 'app_functional.sorted',
'any' : 'app_functional.any',
'all' : 'app_functional.all',
diff --git a/pypy/module/__builtin__/app_functional.py b/pypy/module/__builtin__/app_functional.py
--- a/pypy/module/__builtin__/app_functional.py
+++ b/pypy/module/__builtin__/app_functional.py
@@ -5,12 +5,6 @@
# ____________________________________________________________
-def apply(function, args=(), kwds={}):
- """call a function (or other callable object) and return its result"""
- return function(*args, **kwds)
-
-# ____________________________________________________________
-
def sorted(lst, key=None, reverse=None):
"sorted(iterable, key=None, reverse=False) --> new sorted list"
sorted_lst = list(lst)
diff --git a/pypy/module/__builtin__/test/test_apply.py b/pypy/module/__builtin__/test/test_apply.py
deleted file mode 100644
--- a/pypy/module/__builtin__/test/test_apply.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import autopath
-
-
-# This is a very trivial series of tests. If apply is subtlely broken,
-# we will have to find out some other way.
-
-class AppTestApply:
-
- def test_trivial_listonly(self):
- def mymin(*args):
- return min(list(args))
-
- assert apply(mymin, [-1,-2,-3,-4]) == -4
-
- def test_trivial_dictonly(self):
- def mymin(*arr, **kwargs):
- return min(list(arr) + kwargs.values())
- assert apply(mymin,
- [], {'null' : 0, 'one': 1, 'two' : 2}) == (
- 0)
- def test_trivial(self):
- def mymin(*arr, **kwargs):
- return min(list(arr) + kwargs.values())
- assert apply(mymin,
- [-1,-2,-3,-4],
- {'null' : 0, 'one': 1, 'two' : 2}) == (
- (-4))
More information about the pypy-commit
mailing list