[Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.13,1.14
akuchling@users.sourceforge.net
akuchling@users.sourceforge.net
2002年5月24日 14:09:00 -0700
Update of /cvsroot/python/python/dist/src/Doc/whatsnew
In directory usw-pr-cvs1:/tmp/cvs-serv27948
Modified Files:
whatsnew23.tex
Log Message:
Mention math.degrees() and math.radians()
Other minor rewrites
Index: whatsnew23.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** whatsnew23.tex 10 May 2002 21:00:05 -0000 1.13
--- whatsnew23.tex 24 May 2002 21:08:58 -0000 1.14
***************
*** 294,305 ****
Python's Booleans were not added for the sake of strict type-checking.
! A very strict language such as Pascal
! % XXX is Pascal the right example here?
! would also prevent you performing arithmetic with Booleans, and would
! require that the expression in an \keyword{if} statement always
! evaluate to a Boolean. Python is not this strict, and it never will
! be. (\pep{285} explicitly says this.) So you can still use any
! expression in an \keyword{if}, even ones that evaluate to a list or
! tuple or some random object, and the Boolean type is a subclass of the
\class{int} class, so arithmetic using a Boolean still works.
--- 294,304 ----
Python's Booleans were not added for the sake of strict type-checking.
! A very strict language such as Pascal would also prevent you
! performing arithmetic with Booleans, and would require that the
! expression in an \keyword{if} statement always evaluate to a Boolean.
! Python is not this strict, and it never will be. (\pep{285}
! explicitly says so.) So you can still use any expression in an
! \keyword{if}, even ones that evaluate to a list or tuple or some
! random object, and the Boolean type is a subclass of the
\class{int} class, so arithmetic using a Boolean still works.
***************
*** 383,394 ****
\begin{itemize}
! \item To allocate and free an undistinguished chunk of memory, use
! \cfunction{PyMem_Malloc()}, \cfunction{PyMem_Realloc()},
! \cfunction{PyMem_Free()}, and the other \cfunction{PyMem_*}
! functions.
\item To allocate and free Python objects,
use \cfunction{PyObject_New()}, \cfunction{PyObject_NewVar()}, and
\cfunction{PyObject_Del()}.
\end{itemize}
--- 382,399 ----
\begin{itemize}
! \item To allocate and free an undistinguished chunk of memory using
! Python's allocator, use
! \cfunction{PyMem_Malloc()}, \cfunction{PyMem_Realloc()}, and
! \cfunction{PyMem_Free()}.
!
! \item In rare cases you may want to avoid using Python's allocator
! in order to allocate a chunk of memory;
! use \cfunction{PyObject_Malloc}, \cfunction{PyObject_Realloc},
! and \cfunction{PyObject_Free}.
\item To allocate and free Python objects,
use \cfunction{PyObject_New()}, \cfunction{PyObject_NewVar()}, and
\cfunction{PyObject_Del()}.
+
\end{itemize}
***************
*** 492,495 ****
--- 497,507 ----
>>>
\end{verbatim}
+
+ \item Two new functions in the \module{math} module,
+ \function{degrees(\var{rads})} and \function{radians(\var{degs})},
+ convert between radians and degrees. Other functions in the
+ \module{math} module such as
+ \function{math.sin()} and \function{math.cos()} have always required
+ input values measured in radians. (Contributed by Raymond Hettinger.)
\item Two new functions, \function{killpg()} and \function{mknod()},