1. Aaron Iles
  2. pypy

Commits

Benjamin Peterson  committed 440690f

(buchuki) remove apply

  • Participants
  • Parent commits f934e48
  • Branches py3k

Comments (0)

Files changed (3)

File pypy/module/__builtin__/__init__.py

View file
  • Ignore whitespace
         'input'         : 'app_io.input',
         'print'         : 'app_io.print_',
 
-        'apply'         : 'app_functional.apply',
         'sorted'        : 'app_functional.sorted',
         'any'           : 'app_functional.any',
         'all'           : 'app_functional.all',

File pypy/module/__builtin__/app_functional.py

View file
  • Ignore whitespace
 
 # ____________________________________________________________
 
-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)

File pypy/module/__builtin__/test/test_apply.py

  • Ignore whitespace
-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))