| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 16f3e03 commit 89f507f
363 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -213,6 +213,9 @@ def _ClassDef(self, t): | |||
| 213 | 213 | ||
| 214 | 214 | def _FunctionDef(self, t): | |
| 215 | 215 | self.write("\n") | |
| 216 | + for deco in t.decorators: | ||
| 217 | + self.fill("@") | ||
| 218 | + self.dispatch(deco) | ||
| 216 | 219 | self.fill("def "+t.name + "(") | |
| 217 | 220 | self.dispatch(t.args) | |
| 218 | 221 | self.write(")") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -122,7 +122,7 @@ EMACS= emacs | |||
| 122 | 122 | ||
| 123 | 123 | # The end of this should reflect the major/minor version numbers of | |
| 124 | 124 | # the release: | |
| 125 | - WHATSNEW=whatsnew25 | ||
| 125 | + WHATSNEW=whatsnew26 | ||
| 126 | 126 | ||
| 127 | 127 | # what's what | |
| 128 | 128 | MANDVIFILES= paper-$(PAPER)/api.dvi paper-$(PAPER)/ext.dvi \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -602,15 +602,15 @@ \subsection{String Objects \label{stringObjects}} | |||
| 602 | 602 | \end{cfuncdesc} | |
| 603 | 603 | ||
| 604 | 604 | \begin{cfuncdesc}{PyObject*}{PyString_FromString}{const char *v} | |
| 605 | - Return a new string object with the value \var{v} on success, and | ||
| 606 | - \NULL{} on failure. The parameter \var{v} must not be \NULL{}; it | ||
| 607 | - will not be checked. | ||
| 605 | + Return a new string object with a copy of the string \var{v} as value | ||
| 606 | + on success, and \NULL{} on failure. The parameter \var{v} must not be | ||
| 607 | + \NULL{}; it will not be checked. | ||
| 608 | 608 | \end{cfuncdesc} | |
| 609 | 609 | ||
| 610 | 610 | \begin{cfuncdesc}{PyObject*}{PyString_FromStringAndSize}{const char *v, | |
| 611 | 611 | Py_ssize_t len} | |
| 612 | - Return a new string object with the value \var{v} and length | ||
| 613 | - \var{len} on success, and \NULL{} on failure. If \var{v} is | ||
| 612 | + Return a new string object with a copy of the string \var{v} as value | ||
| 613 | + and length \var{len} on success, and \NULL{} on failure. If \var{v} is | ||
| 614 | 614 | \NULL{}, the contents of the string are uninitialized. | |
| 615 | 615 | \end{cfuncdesc} | |
| 616 | 616 | ||
@@ -2879,10 +2879,10 @@ \subsection{DateTime Objects \label{datetime-objects}} | |||
| 2879 | 2879 | Various date and time objects are supplied by the \module{datetime} | |
| 2880 | 2880 | module. Before using any of these functions, the header file | |
| 2881 | 2881 | \file{datetime.h} must be included in your source (note that this is | |
| 2882 | - not include by \file{Python.h}), and macro \cfunction{PyDateTime_IMPORT()} | ||
| 2883 | - must be invoked. The macro arranges to put a pointer to a C structure | ||
| 2884 | - in a static variable \code{PyDateTimeAPI}, which is used by the following | ||
| 2885 | - macros. | ||
| 2882 | + not included by \file{Python.h}), and the macro | ||
| 2883 | + \cfunction{PyDateTime_IMPORT} must be invoked. The macro puts a | ||
| 2884 | + pointer to a C structure into a static variable, | ||
| 2885 | + \code{PyDateTimeAPI}, that is used by the following macros. | ||
| 2886 | 2886 | ||
| 2887 | 2887 | Type-check macros: | |
| 2888 | 2888 | ||
@@ -3080,9 +3080,9 @@ \subsection{Set Objects \label{setObjects}} | |||
| 3080 | 3080 | \cfunction{PyObject_IsTrue()}, \cfunction{PyObject_Print()}, and | |
| 3081 | 3081 | \cfunction{PyObject_GetIter()}) | |
| 3082 | 3082 | or the abstract number protocol (including | |
| 3083 | - \cfunction{PyNumber_Add()}, \cfunction{PyNumber_Subtract()}, | ||
| 3083 | + \cfunction{PyNumber_And()}, \cfunction{PyNumber_Subtract()}, | ||
| 3084 | 3084 | \cfunction{PyNumber_Or()}, \cfunction{PyNumber_Xor()}, | |
| 3085 | - \cfunction{PyNumber_InPlaceAdd()}, \cfunction{PyNumber_InPlaceSubtract()}, | ||
| 3085 | + \cfunction{PyNumber_InPlaceAnd()}, \cfunction{PyNumber_InPlaceSubtract()}, | ||
| 3086 | 3086 | \cfunction{PyNumber_InPlaceOr()}, and \cfunction{PyNumber_InPlaceXor()}). | |
| 3087 | 3087 | ||
| 3088 | 3088 | \begin{ctypedesc}{PySetObject} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -325,7 +325,7 @@ \chapter{Exception Handling \label{exceptionHandling}} | |||
| 325 | 325 | default effect for \constant{SIGINT}\ttindex{SIGINT} is to raise the | |
| 326 | 326 | \withsubitem{(built-in exception)}{\ttindex{KeyboardInterrupt}} | |
| 327 | 327 | \exception{KeyboardInterrupt} exception. If an exception is raised | |
| 328 | - the error indicator is set and the function returns \code{1}; | ||
| 328 | + the error indicator is set and the function returns \code{-1}; | ||
| 329 | 329 | otherwise the function returns \code{0}. The error indicator may or | |
| 330 | 330 | may not be cleared if it was previously set. | |
| 331 | 331 | \end{cfuncdesc} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3607,6 +3607,11 @@ \section{\module{distutils.command.bdist_dumb} --- Build a ``dumb'' installer} | |||
| 3607 | 3607 | ||
| 3608 | 3608 | % todo | |
| 3609 | 3609 | ||
| 3610 | + \section{\module{distutils.command.bdist_msi} --- Build a Microsoft Installer binary package} | ||
| 3611 | + \declaremodule[distutils.command.bdistmsi]{standard}{distutils.command.bdist_msi} | ||
| 3612 | + \modulesynopsis{Build a binary distribution as a Windows MSI file} | ||
| 3613 | + | ||
| 3614 | + % todo | ||
| 3610 | 3615 | ||
| 3611 | 3616 | \section{\module{distutils.command.bdist_rpm} --- Build a binary distribution as a Redhat RPM and SRPM} | |
| 3612 | 3617 | \declaremodule[distutils.command.bdistrpm]{standard}{distutils.command.bdist_rpm} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -220,6 +220,8 @@ \section{Intermezzo: Errors and Exceptions | |||
| 220 | 220 | PyObject *m; | |
| 221 | 221 | ||
| 222 | 222 | m = Py_InitModule("spam", SpamMethods); | |
| 223 | + if (m == NULL) | ||
| 224 | + return; | ||
| 223 | 225 | ||
| 224 | 226 | SpamError = PyErr_NewException("spam.error", NULL, NULL); | |
| 225 | 227 | Py_INCREF(SpamError); | |
@@ -364,9 +366,9 @@ \section{The Module's Method Table and Initialization Function | |||
| 364 | 366 | created module based upon the table (an array of \ctype{PyMethodDef} | |
| 365 | 367 | structures) that was passed as its second argument. | |
| 366 | 368 | \cfunction{Py_InitModule()} returns a pointer to the module object | |
| 367 | - that it creates (which is unused here). It aborts with a fatal error | ||
| 368 | - if the module could not be initialized satisfactorily, so the caller | ||
| 369 | - doesn't need to check for errors. | ||
| 369 | + that it creates (which is unused here). It may abort with a fatal error | ||
| 370 | + for certain errors, or return \NULL{} if the module could not be | ||
| 371 | + initialized satisfactorily. | ||
| 370 | 372 | ||
| 371 | 373 | When embedding Python, the \cfunction{initspam()} function is not | |
| 372 | 374 | called automatically unless there's an entry in the | |
@@ -1275,6 +1277,8 @@ \section{Providing a C API for an Extension Module | |||
| 1275 | 1277 | PyObject *c_api_object; | |
| 1276 | 1278 | ||
| 1277 | 1279 | m = Py_InitModule("spam", SpamMethods); | |
| 1280 | + if (m == NULL) | ||
| 1281 | + return; | ||
| 1278 | 1282 | ||
| 1279 | 1283 | /* Initialize the C API pointer array */ | |
| 1280 | 1284 | PySpam_API[PySpam_System_NUM] = (void *)PySpam_System; | |
@@ -1361,7 +1365,9 @@ \section{Providing a C API for an Extension Module | |||
| 1361 | 1365 | { | |
| 1362 | 1366 | PyObject *m; | |
| 1363 | 1367 | ||
| 1364 | - Py_InitModule("client", ClientMethods); | ||
| 1368 | + m = Py_InitModule("client", ClientMethods); | ||
| 1369 | + if (m == NULL) | ||
| 1370 | + return; | ||
| 1365 | 1371 | if (import_spam() < 0) | |
| 1366 | 1372 | return; | |
| 1367 | 1373 | /* additional initialization can happen here */ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments