[Python-checkins] CVS: python/dist/src/Doc/lib libbisect.tex,1.8,1.9
Fred L. Drake
python-dev@python.org
Thu, 04 Jan 2001 06:18:58 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv9470/lib
Modified Files:
libbisect.tex
Log Message:
Based on comments from Guido, do not describe bisect() and insert() as
being "for backward compatibility." Also revert to using bisect() in the
example, since Guido thinks that is the best recommendation for typical
usage.
Index: libbisect.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libbisect.tex,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** libbisect.tex 2001/01/04 05:12:52 1.8
--- libbisect.tex 2001/01/04 14:18:55 1.9
***************
*** 40,44 ****
\begin{funcdesc}{bisect}{\unspecified}
! Alias for \function{bisect_right()} for backward compatibility.
\end{funcdesc}
--- 40,44 ----
\begin{funcdesc}{bisect}{\unspecified}
! Alias for \function{bisect_right()}.
\end{funcdesc}
***************
*** 58,62 ****
\begin{funcdesc}{insort}{\unspecified}
! Alias for \function{insort_right()} for backward compatibility.
\end{funcdesc}
--- 58,62 ----
\begin{funcdesc}{insort}{\unspecified}
! Alias for \function{insort_right()}.
\end{funcdesc}
***************
*** 66,70 ****
The \function{bisect()} function is generally useful for categorizing
! numeric data. This example uses \function{bisect_right()} to look up a
letter grade for an exam total (say) based on a set of ordered numeric
breakpoints: 85 and up is an `A', 75..84 is a `B', etc.
--- 66,70 ----
The \function{bisect()} function is generally useful for categorizing
! numeric data. This example uses \function{bisect()} to look up a
letter grade for an exam total (say) based on a set of ordered numeric
breakpoints: 85 and up is an `A', 75..84 is a `B', etc.
***************
*** 73,79 ****
>>> grades = "FEDCBA"
>>> breakpoints = [30, 44, 66, 75, 85]
! >>> from bisect import bisect_right
>>> def grade(total):
! ... return grades[bisect_right(breakpoints, total)]
...
>>> grade(66)
--- 73,79 ----
>>> grades = "FEDCBA"
>>> breakpoints = [30, 44, 66, 75, 85]
! >>> from bisect import bisect
>>> def grade(total):
! ... return grades[bisect(breakpoints, total)]
...
>>> grade(66)