[pypy-commit] pypy default: Clarify or fix these comments.
arigo
noreply at buildbot.pypy.org
Sun Feb 19 21:03:45 CET 2012
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r52654:506419ff7de5
Date: 2012-02-19 21:01 +0100
http://bitbucket.org/pypy/pypy/changeset/506419ff7de5/
Log: Clarify or fix these comments.
diff --git a/pypy/rlib/objectmodel.py b/pypy/rlib/objectmodel.py
--- a/pypy/rlib/objectmodel.py
+++ b/pypy/rlib/objectmodel.py
@@ -23,9 +23,11 @@
class _Specialize(object):
def memo(self):
- """ Specialize functions based on argument values. All arguments has
- to be constant at the compile time. The whole function call is replaced
- by a call result then.
+ """ Specialize the function based on argument values. All arguments
+ have to be either constants or PBCs (i.e. instances of classes with a
+ _freeze_ method returning True). The function call is replaced by
+ just its result, or in case several PBCs are used, by some fast
+ look-up of the result.
"""
def decorated_func(func):
func._annspecialcase_ = 'specialize:memo'
@@ -33,8 +35,8 @@
return decorated_func
def arg(self, *args):
- """ Specialize function based on values of given positions of arguments.
- They must be compile-time constants in order to work.
+ """ Specialize the function based on the values of given positions
+ of arguments. They must be compile-time constants in order to work.
There will be a copy of provided function for each combination
of given arguments on positions in args (that can lead to
@@ -82,8 +84,7 @@
return decorated_func
def ll_and_arg(self, *args):
- """ This is like ll(), but instead of specializing on all arguments,
- specializes on only the arguments at the given positions
+ """ This is like ll(), and additionally like arg(...).
"""
def decorated_func(func):
func._annspecialcase_ = 'specialize:ll_and_arg' + self._wrap(args)
More information about the pypy-commit
mailing list