PEP 3114: rename .next() to .__next__() and add next() builtin.
diff --git a/Doc/lib/libcollections.tex b/Doc/lib/libcollections.tex
index a763e31..5a07a2d 100644
--- a/Doc/lib/libcollections.tex
+++ b/Doc/lib/libcollections.tex
@@ -174,7 +174,7 @@
     while pending:
         task = pending.popleft()
         try:
-            yield task.next()
+            yield next(task)
         except StopIteration:
             continue
         pending.append(task)
@@ -315,12 +315,12 @@
 
 The function \function{int()} which always returns zero is just a special
 case of constant functions.  A faster and more flexible way to create
-constant functions is to use \function{itertools.repeat()} which can supply
+constant functions is to use a lambda function which can supply
 any constant value (not just zero):
 
 \begin{verbatim}
 >>> def constant_factory(value):
-...     return itertools.repeat(value).next
+...     return lambda: value
 >>> d = defaultdict(constant_factory('<missing>'))
 >>> d.update(name='John', action='ran')
 >>> '%(name)s %(action)s to %(object)s' % d
diff --git a/Doc/lib/libcsv.tex b/Doc/lib/libcsv.tex
index b87bc9d..54fc8db 100644
--- a/Doc/lib/libcsv.tex
+++ b/Doc/lib/libcsv.tex
@@ -487,8 +487,8 @@
     def __iter__(self):
         return self
 
-    def next(self):
-        return self.reader.next().encode("utf-8")
+    def __next__(self):
+        return next(self.reader).encode("utf-8")
 
 class UnicodeReader:
     """
@@ -500,8 +500,8 @@
         f = UTF8Recoder(f, encoding)
         self.reader = csv.reader(f, dialect=dialect, **kwds)
 
-    def next(self):
-        row = self.reader.next()
+    def __next__(self):
+        row = next(self.reader)
         return [unicode(s, "utf-8") for s in row]
 
     def __iter__(self):
diff --git a/Doc/lib/libdis.tex b/Doc/lib/libdis.tex
index 4b0d63b..2d78d9a 100644
--- a/Doc/lib/libdis.tex
+++ b/Doc/lib/libdis.tex
@@ -529,10 +529,10 @@
 \end{opcodedesc}
 
 \begin{opcodedesc}{FOR_ITER}{delta}
-\code{TOS} is an iterator.  Call its \method{next()} method.  If this
-yields a new value, push it on the stack (leaving the iterator below
-it).  If the iterator indicates it is exhausted  \code{TOS} is
-popped, and the byte code counter is incremented by \var{delta}.
+  \code{TOS} is an iterator.  Call its \method{__next__()} method.  If this
+  yields a new value, push it on the stack (leaving the iterator below it).  If
+  the iterator indicates it is exhausted \code{TOS} is popped, and the byte code
+  counter is incremented by \var{delta}.
 \end{opcodedesc}
 
 %\begin{opcodedesc}{FOR_LOOP}{delta}
diff --git a/Doc/lib/libexcs.tex b/Doc/lib/libexcs.tex
index 02e99a7..d119ed9 100644
--- a/Doc/lib/libexcs.tex
+++ b/Doc/lib/libexcs.tex
@@ -265,8 +265,8 @@
 \end{excdesc}
 
 \begin{excdesc}{StopIteration}
-  Raised by an iterator's \method{next()} method to signal that there
-  are no further values.
+  Raised by builtin \function{next()} and an iterator's \method{__next__()}
+  method to signal that there are no further values.
   This is derived from \exception{Exception} rather than
   \exception{StandardError}, since this is not considered an error in
   its normal application.
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex
index b1d2983..b488ce4 100644
--- a/Doc/lib/libfuncs.tex
+++ b/Doc/lib/libfuncs.tex
@@ -342,14 +342,12 @@
 \end{funcdesc}
 
 \begin{funcdesc}{enumerate}{iterable}
-  Return an enumerate object. \var{iterable} must be a sequence, an
-  iterator, or some other object which supports iteration.  The
-  \method{next()} method of the iterator returned by
-  \function{enumerate()} returns a tuple containing a count (from
-  zero) and the corresponding value obtained from iterating over
-  \var{iterable}.  \function{enumerate()} is useful for obtaining an
-  indexed series: \code{(0, seq[0])}, \code{(1, seq[1])}, \code{(2,
-  seq[2])}, \ldots.
+  Return an enumerate object. \var{iterable} must be a sequence, an iterator, or
+  some other object which supports iteration.  The \method{__next__()} method of
+  the iterator returned by \function{enumerate()} returns a tuple containing a
+  count (from zero) and the corresponding value obtained from iterating over
+  \var{iterable}.  \function{enumerate()} is useful for obtaining an indexed
+  series: \code{(0, seq[0])}, \code{(1, seq[1])}, \code{(2, seq[2])}, \ldots.
   \versionadded{2.3}
 \end{funcdesc}
 
@@ -615,7 +613,7 @@
   support either of those protocols, \exception{TypeError} is raised.
   If the second argument, \var{sentinel}, is given, then \var{o} must
   be a callable object.  The iterator created in this case will call
-  \var{o} with no arguments for each call to its \method{next()}
+  \var{o} with no arguments for each call to its \method{__next__()}
   method; if the value returned is equal to \var{sentinel},
   \exception{StopIteration} will be raised, otherwise the value will
   be returned.
@@ -695,6 +693,12 @@
   \versionchanged[Added support for the optional \var{key} argument]{2.5}
 \end{funcdesc}
 
+\begin{funcdesc}{next}{iterator\optional{, default}}
+  Retrieve the next item from the \var{iterable} by calling its
+  \method{__next__()} method.  If \var{default} is given, it is returned if the
+  iterator is exhausted, otherwise \exception{StopIteration} is raised.
+\end{funcdesc}
+
 \begin{funcdesc}{object}{}
   Return a new featureless object.  \class{object} is a base
   for all new style classes.  It has the methods that are common
diff --git a/Doc/lib/libitertools.tex b/Doc/lib/libitertools.tex
index ac6028b..a2f37d7 100644
--- a/Doc/lib/libitertools.tex
+++ b/Doc/lib/libitertools.tex
@@ -164,16 +164,16 @@
             self.tgtkey = self.currkey = self.currvalue = xrange(0)
         def __iter__(self):
             return self
-        def next(self):
+        def __next__(self):
             while self.currkey == self.tgtkey:
-                self.currvalue = self.it.next() # Exit on StopIteration
+                self.currvalue = next(self.it) # Exit on StopIteration
                 self.currkey = self.keyfunc(self.currvalue)
             self.tgtkey = self.currkey
             return (self.currkey, self._grouper(self.tgtkey))
         def _grouper(self, tgtkey):
             while self.currkey == tgtkey:
                 yield self.currvalue
-                self.currvalue = self.it.next() # Exit on StopIteration
+                self.currvalue = next(self.it) # Exit on StopIteration
                 self.currkey = self.keyfunc(self.currvalue)
   \end{verbatim}
   \versionadded{2.4}
@@ -227,7 +227,7 @@
      def imap(function, *iterables):
          iterables = map(iter, iterables)
          while True:
-             args = [i.next() for i in iterables]
+             args = [next(i) for i in iterables]
              if function is None:
                  yield tuple(args)
              else:
@@ -253,11 +253,11 @@
      def islice(iterable, *args):
          s = slice(*args)
          it = iter(xrange(s.start or 0, s.stop or sys.maxint, s.step or 1))
-         nexti = it.next()
+         nexti = next(it)
          for i, element in enumerate(iterable):
              if i == nexti:
                  yield element
-                 nexti = it.next()          
+                 nexti = next(it)
   \end{verbatim}
 
   If \var{start} is \code{None}, then iteration starts at zero.
@@ -276,7 +276,7 @@
      def izip(*iterables):
          iterables = map(iter, iterables)
          while iterables:
-             result = [it.next() for it in iterables]
+             result = [next(it) for it in iterables]
              yield tuple(result)
   \end{verbatim}
 
@@ -297,7 +297,7 @@
   from each iterator in-turn, but the process ends when one of the iterators
   terminates.  This leaves the last fetched values in limbo (they cannot be
   returned in a final, incomplete tuple and they are cannot be pushed back
-  into the iterator for retrieval with \code{it.next()}).  In general,
+  into the iterator for retrieval with \code{next(it)}).  In general,
   \function{izip()} should only be used with unequal length inputs when you
   don't care about trailing, unmatched values from the longer iterables.
 \end{funcdesc}
@@ -360,7 +360,7 @@
      def starmap(function, iterable):
          iterable = iter(iterable)
          while True:
-             yield function(*iterable.next())
+             yield function(*next(iterable))
   \end{verbatim}
 \end{funcdesc}
 
@@ -393,7 +393,7 @@
                      item = data.pop(i)
                  yield item
          it = iter(iterable)
-         return (gen(it.next), gen(it.next))
+         return (gen(it.__next__), gen(it.__next__))
   \end{verbatim}
 
   Note, once \function{tee()} has made a split, the original \var{iterable}
@@ -556,10 +556,7 @@
 def pairwise(iterable):
     "s -> (s0,s1), (s1,s2), (s2, s3), ..."
     a, b = tee(iterable)
-    try:
-        b.next()
-    except StopIteration:
-        pass
+    next(b, None)
     return izip(a, b)
 
 def grouper(n, iterable, padvalue=None):
diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex
index f3ce92a..d7b8858 100644
--- a/Doc/lib/libstdtypes.tex
+++ b/Doc/lib/libstdtypes.tex
@@ -388,18 +388,17 @@
 specialized forms.  The specific types are not important beyond their
 implementation of the iterator protocol.
 
-The intention of the protocol is that once an iterator's
-\method{next()} method raises \exception{StopIteration}, it will
-continue to do so on subsequent calls.  Implementations that
-do not obey this property are deemed broken.  (This constraint
-was added in Python 2.3; in Python 2.2, various iterators are
-broken according to this rule.)
+The intention of the protocol is that once an iterator's \method{__next__()}
+method raises \exception{StopIteration}, it will continue to do so on subsequent
+calls.  Implementations that do not obey this property are deemed broken.  (This
+constraint was added in Python 2.3; in Python 2.2, various iterators are broken
+according to this rule.)
 
-Python's generators provide a convenient way to implement the
-iterator protocol.  If a container object's \method{__iter__()}
-method is implemented as a generator, it will automatically
-return an iterator object (technically, a generator object)
-supplying the \method{__iter__()} and \method{next()} methods.
+Python's generators provide a convenient way to implement the iterator protocol.
+If a container object's \method{__iter__()} method is implemented as a
+generator, it will automatically return an iterator object (technically, a
+generator object) supplying the \method{__iter__()} and \method{__next__()}
+methods.
 
 
 \section{Sequence Types ---
@@ -1587,17 +1586,17 @@
   with a real file, this method should \emph{not} be implemented.}
 \end{methoddesc}
 
-\begin{methoddesc}[file]{next}{}
+\begin{methoddesc}[file]{__next__}{}
 A file object is its own iterator, for example \code{iter(\var{f})} returns
 \var{f} (unless \var{f} is closed).  When a file is used as an
 iterator, typically in a \keyword{for} loop (for example,
-\code{for line in f: print line}), the \method{next()} method is
+\code{for line in f: print line}), the \method{__next__()} method is
 called repeatedly.  This method returns the next input line, or raises
 \exception{StopIteration} when \EOF{} is hit.  In order to make a
 \keyword{for} loop the most efficient way of looping over the lines of
-a file (a very common operation), the \method{next()} method uses a
+a file (a very common operation), the \method{__next__()} method uses a
 hidden read-ahead buffer.  As a consequence of using a read-ahead
-buffer, combining \method{next()} with other file methods (like
+buffer, combining \method{__next__()} with other file methods (like
 \method{readline()}) does not work right.  However, using
 \method{seek()} to reposition the file to an absolute position will
 flush the read-ahead buffer.
diff --git a/Doc/lib/sqlite3/executemany_1.py b/Doc/lib/sqlite3/executemany_1.py
index 24357c5..2dc72cd 100644
--- a/Doc/lib/sqlite3/executemany_1.py
+++ b/Doc/lib/sqlite3/executemany_1.py
@@ -7,7 +7,7 @@
     def __iter__(self):
         return self
 
-    def next(self):
+    def __next__(self):
         if self.count > ord('z'):
             raise StopIteration
         self.count += 1