| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
35 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -285,7 +285,7 @@ an error value). | |||
| 285 | 285 | .. c:function:: int PyErr_WarnEx(PyObject *category, const char *message, Py_ssize_t stack_level) | |
| 286 | 286 | ||
| 287 | 287 | Issue a warning message. The *category* argument is a warning category (see | |
| 288 | - below) or *NULL*; the *message* argument is an UTF-8 encoded string. *stack_level* is a | ||
| 288 | + below) or *NULL*; the *message* argument is a UTF-8 encoded string. *stack_level* is a | ||
| 289 | 289 | positive number giving a number of stack frames; the warning will be issued from | |
| 290 | 290 | the currently executing line of code in that stack frame. A *stack_level* of 1 | |
| 291 | 291 | is the function calling :c:func:`PyErr_WarnEx`, 2 is the function above that, | |
@@ -617,7 +617,7 @@ The following functions are used to create and modify Unicode exceptions from C. | |||
| 617 | 617 | .. c:function:: PyObject* PyUnicodeTranslateError_Create(const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason) | |
| 618 | 618 | ||
| 619 | 619 | Create a :class:`UnicodeTranslateError` object with the attributes *object*, | |
| 620 | - *length*, *start*, *end* and *reason*. *reason* is an UTF-8 encoded string. | ||
| 620 | + *length*, *start*, *end* and *reason*. *reason* is a UTF-8 encoded string. | ||
| 621 | 621 | ||
| 622 | 622 | .. c:function:: PyObject* PyUnicodeDecodeError_GetEncoding(PyObject *exc) | |
| 623 | 623 | PyObject* PyUnicodeEncodeError_GetEncoding(PyObject *exc) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,7 +72,7 @@ Importing Modules | |||
| 72 | 72 | ||
| 73 | 73 | .. c:function:: PyObject* PyImport_ImportModuleLevel(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) | |
| 74 | 74 | ||
| 75 | - Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is an | ||
| 75 | + Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is a | ||
| 76 | 76 | UTF-8 encoded string instead of a Unicode object. | |
| 77 | 77 | ||
| 78 | 78 | .. versionchanged:: 3.3 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,7 +49,7 @@ Method Objects | |||
| 49 | 49 | .. index:: object: method | |
| 50 | 50 | ||
| 51 | 51 | Methods are bound function objects. Methods are always bound to an instance of | |
| 52 | - an user-defined class. Unbound methods (methods bound to a class object) are | ||
| 52 | + a user-defined class. Unbound methods (methods bound to a class object) are | ||
| 53 | 53 | no longer available. | |
| 54 | 54 | ||
| 55 | 55 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,7 +50,7 @@ Module Objects | |||
| 50 | 50 | ||
| 51 | 51 | .. c:function:: PyObject* PyModule_New(const char *name) | |
| 52 | 52 | ||
| 53 | - Similar to :c:func:`PyImport_NewObject`, but the name is an UTF-8 encoded | ||
| 53 | + Similar to :c:func:`PyImport_NewObject`, but the name is a UTF-8 encoded | ||
| 54 | 54 | string instead of a Unicode object. | |
| 55 | 55 | ||
| 56 | 56 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -423,7 +423,7 @@ APIs: | |||
| 423 | 423 | ||
| 424 | 424 | .. c:function:: PyObject *PyUnicode_FromString(const char *u) | |
| 425 | 425 | ||
| 426 | - Create a Unicode object from an UTF-8 encoded null-terminated char buffer | ||
| 426 | + Create a Unicode object from a UTF-8 encoded null-terminated char buffer | ||
| 427 | 427 | *u*. | |
| 428 | 428 | ||
| 429 | 429 | ||
@@ -556,14 +556,13 @@ APIs: | |||
| 556 | 556 | .. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, \ | |
| 557 | 557 | const char *encoding, const char *errors) | |
| 558 | 558 | ||
| 559 | - Coerce an encoded object *obj* to an Unicode object and return a reference with | ||
| 560 | - incremented refcount. | ||
| 559 | + Decode an encoded object *obj* to a Unicode object. | ||
| 561 | 560 | ||
| 562 | 561 | :class:`bytes`, :class:`bytearray` and other | |
| 563 | 562 | :term:`bytes-like objects <bytes-like object>` | |
| 564 | 563 | are decoded according to the given *encoding* and using the error handling | |
| 565 | 564 | defined by *errors*. Both can be *NULL* to have the interface use the default | |
| 566 | - values (see the next section for details). | ||
| 565 | + values (see :ref:`builtincodecs` for details). | ||
| 567 | 566 | ||
| 568 | 567 | All other objects, including Unicode objects, cause a :exc:`TypeError` to be | |
| 569 | 568 | set. | |
@@ -745,8 +744,11 @@ Extension modules can continue using them, as they will not be removed in Python | |||
| 745 | 744 | ||
| 746 | 745 | .. c:function:: PyObject* PyUnicode_FromObject(PyObject *obj) | |
| 747 | 746 | ||
| 748 | - Shortcut for ``PyUnicode_FromEncodedObject(obj, NULL, "strict")`` which is used | ||
| 749 | - throughout the interpreter whenever coercion to Unicode is needed. | ||
| 747 | + Copy an instance of a Unicode subtype to a new true Unicode object if | ||
| 748 | + necessary. If *obj* is already a true Unicode object (not a subtype), | ||
| 749 | + return the reference with incremented refcount. | ||
| 750 | + | ||
| 751 | + Objects other than Unicode or its subtypes will cause a :exc:`TypeError`. | ||
| 750 | 752 | ||
| 751 | 753 | ||
| 752 | 754 | Locale Encoding | |
@@ -1224,7 +1226,7 @@ These are the UTF-16 codec APIs: | |||
| 1224 | 1226 | ||
| 1225 | 1227 | If *Py_UNICODE_WIDE* is defined, a single :c:type:`Py_UNICODE` value may get | |
| 1226 | 1228 | represented as a surrogate pair. If it is not defined, each :c:type:`Py_UNICODE` | |
| 1227 | - values is interpreted as an UCS-2 character. | ||
| 1229 | + values is interpreted as a UCS-2 character. | ||
| 1228 | 1230 | ||
| 1229 | 1231 | Return *NULL* if an exception was raised by the codec. | |
| 1230 | 1232 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,7 +64,7 @@ you can do so via the :func:`~urllib.request.urlretrieve` function:: | |||
| 64 | 64 | html = open(local_filename) | |
| 65 | 65 | ||
| 66 | 66 | Many uses of urllib will be that simple (note that instead of an 'http:' URL we | |
| 67 | - could have used an URL starting with 'ftp:', 'file:', etc.). However, it's the | ||
| 67 | + could have used a URL starting with 'ftp:', 'file:', etc.). However, it's the | ||
| 68 | 68 | purpose of this tutorial to explain the more complicated cases, concentrating on | |
| 69 | 69 | HTTP. | |
| 70 | 70 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -242,7 +242,7 @@ for a tournament. The numbers below are *k*, not ``a[k]``:: | |||
| 242 | 242 | ||
| 243 | 243 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
| 244 | 244 | ||
| 245 | - In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In an usual | ||
| 245 | + In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a usual | ||
| 246 | 246 | binary tournament we see in sports, each cell is the winner over the two cells | |
| 247 | 247 | it tops, and we can trace the winner down the tree to see all opponents s/he | |
| 248 | 248 | had. However, in many computer applications of such tournaments, we do not need | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -874,7 +874,7 @@ supports sending logging messages to a Web server, using either ``GET`` or | |||
| 874 | 874 | ||
| 875 | 875 | .. method:: emit(record) | |
| 876 | 876 | ||
| 877 | - Sends the record to the Web server as an URL-encoded dictionary. The | ||
| 877 | + Sends the record to the Web server as a URL-encoded dictionary. The | ||
| 878 | 878 | :meth:`mapLogRecord` method is used to convert the record to the | |
| 879 | 879 | dictionary to be sent. | |
| 880 | 880 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1762,7 +1762,7 @@ features: | |||
| 1762 | 1762 | ``os.path.join(os.path.dirname(path), result)``. | |
| 1763 | 1763 | ||
| 1764 | 1764 | If the *path* is a string object, the result will also be a string object, | |
| 1765 | - and the call may raise an UnicodeDecodeError. If the *path* is a bytes | ||
| 1765 | + and the call may raise a UnicodeDecodeError. If the *path* is a bytes | ||
| 1766 | 1766 | object, the result will be a bytes object. | |
| 1767 | 1767 | ||
| 1768 | 1768 | This function can also support :ref:`paths relative to directory descriptors | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ those found in Perl. | |||
| 12 | 12 | ||
| 13 | 13 | Both patterns and strings to be searched can be Unicode strings as well as | |
| 14 | 14 | 8-bit strings. However, Unicode strings and 8-bit strings cannot be mixed: | |
| 15 | - that is, you cannot match an Unicode string with a byte pattern or | ||
| 15 | + that is, you cannot match a Unicode string with a byte pattern or | ||
| 16 | 16 | vice-versa; similarly, when asking for a substitution, the replacement | |
| 17 | 17 | string must be of the same type as both the pattern and the search string. | |
| 18 | 18 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments