diff options
| author | Simon McVittie <smcv@collabora.com> | 2018-05-02 11:11:00 +0100 |
|---|---|---|
| committer | Simon McVittie <smcv@collabora.com> | 2018-05-02 12:43:10 +0100 |
| commit | 780e299bc7cd72c30473162e266479656f3ab9ff (patch) | |
| tree | 8d176e1b1b33769143d0f4db9fdea6023929f01a /dbus_bindings | |
| parent | 7457ebb162febe9033ebcc7e6ef44e6f79d19410 (diff) | |
| download | dbus-python-780e299bc7cd72c30473162e266479656f3ab9ff.tar.gz | |
doc: Be more clear about bytes vs. unicode
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'dbus_bindings')
| -rw-r--r-- | dbus_bindings/bytes.c | 8 | ||||
| -rw-r--r-- | dbus_bindings/message-get-args.c | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/dbus_bindings/bytes.c b/dbus_bindings/bytes.c index af8188a..26d6016 100644 --- a/dbus_bindings/bytes.c +++ b/dbus_bindings/bytes.c @@ -204,8 +204,12 @@ PyTypeObject DBusPyByte_Type = { #endif PyDoc_STRVAR(ByteArray_tp_doc, -"ByteArray is a subtype of str which can be used when you want an\n" -"efficient immutable representation of a D-Bus byte array (signature 'ay').\n" +"ByteArray(str)\n" +"\n" +"ByteArray is a subtype of :py:class:`bytes` (an alias for\n" +":py:class:`str` in Python 2 but a distinct type in Python 3)\n" +"which can be used when you want an\n" +"efficient immutable representation of a D-Bus byte array (signature ``ay``).\n" "\n" "By default, when byte arrays are converted from D-Bus to Python, they\n" "come out as a `dbus.Array` of `dbus.Byte`. This is just for symmetry with\n" diff --git a/dbus_bindings/message-get-args.c b/dbus_bindings/message-get-args.c index 49670c1..65596d9 100644 --- a/dbus_bindings/message-get-args.c +++ b/dbus_bindings/message-get-args.c @@ -45,8 +45,8 @@ char dbus_py_Message_get_args_list__doc__[] = ( " If false (default), convert them into a dbus.Array of Bytes.\n" #ifndef PY3 " `utf8_strings` : bool\n" -" If true, return D-Bus strings as Python 8-bit strings (of UTF-8).\n" -" If false (default), return D-Bus strings as Python unicode objects.\n" +" If true, return D-Bus strings as Python `bytes` objects (in UTF-8).\n" +" If false (default), return D-Bus strings as Python `unicode` objects.\n" #endif "\n" "Most of the type mappings should be fairly obvious:\n" @@ -60,7 +60,7 @@ char dbus_py_Message_get_args_list__doc__[] = ( "intNN, uintNN dbus.IntNN, dbus.UIntNN (int or long subclasses)\n" "double (d) dbus.Double\n" "string (s) dbus.String (unicode subclass)\n" -" (or dbus.UTF8String, str subclass, if utf8_strings set)\n" +" (or dbus.UTF8String, bytes subclass, if utf8_strings set)\n" "Object path (o) dbus.ObjectPath (str subclass)\n" "dict (a{...}) dbus.Dictionary\n" "array (a...) dbus.Array (list subclass) containing appropriate types\n" |
