src/google/appengine/api/mail.py [706:732]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def _positional(max_pos_args):
  """A decorator to declare that only the first N arguments can be positional.

  Note:
      For methods, N includes 'self'.

  Args:
    max_pos_args: The number of arguments that can be positional.

  Returns:
    The wrapped object, but verifies that the wrapped object does not have more
    than `max_pos_args`. If the object does contain more than `max_pos_args`
    arguments, a `TypeError` is raised.
  """
  def positional_decorator(wrapped):
    @functools.wraps(wrapped)
    def positional_wrapper(*args, **kwds):
      if len(args) > max_pos_args:
        plural_s = ''
        if max_pos_args != 1:
          plural_s = 's'
        raise TypeError(
            '%s() takes at most %d positional argument%s (%d given)' %
            (wrapped.__name__, max_pos_args, plural_s, len(args)))
      return wrapped(*args, **kwds)
    return positional_wrapper
  return positional_decorator
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/google/appengine/datastore/datastore_rpc.py [79:96]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def _positional(max_pos_args):
  """A decorator to declare that only the first N arguments may be positional.

  Note that for methods, n includes 'self'.
  """
  def positional_decorator(wrapped):
    @functools.wraps(wrapped)
    def positional_wrapper(*args, **kwds):
      if len(args) > max_pos_args:
        plural_s = ''
        if max_pos_args != 1:
          plural_s = 's'
        raise TypeError(
          '%s() takes at most %d positional argument%s (%d given)' %
          (wrapped.__name__, max_pos_args, plural_s, len(args)))
      return wrapped(*args, **kwds)
    return positional_wrapper
  return positional_decorator
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



