Skip to content

Commit e52812f

Browse files
windmgcmethane
authored andcommitted
Improve docstring of use_unicode and charset options (#345)
1 parent 1a67ae2 commit e52812f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

MySQLdb/connections.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,23 @@ class object, used to create cursors (keyword only)
7373
7474
:param bool use_unicode:
7575
If True, text-like columns are returned as unicode objects
76-
using the connection's character set. Otherwise, text-like
77-
columns are returned as strings. columns are returned as
78-
normal strings. Unicode objects will always be encoded to
79-
the connection's character set regardless of this setting.
80-
Default to False on Python 2 and True on Python 3.
76+
using the connection's character set. Otherwise, text-like
77+
columns are returned as bytes. Unicode objects will always
78+
be encoded to the connection's character set regardless of
79+
this setting.
80+
Default to False on Python 2 and True on Python 3
81+
so that you can always get python `str` object by default.
8182
8283
:param str charset:
8384
If supplied, the connection character set will be changed
84-
to this character set (MySQL-4.1 and newer). This implies
85-
use_unicode=True.
85+
to this character set.
86+
On Python 2, this option changes default value of `use_unicode`
87+
option from False to True.
8688
8789
:param str sql_mode:
8890
If supplied, the session SQL mode will be changed to this
89-
setting (MySQL-4.1 and newer). For more details and legal
90-
values, see the MySQL documentation.
91+
setting.
92+
For more details and legal values, see the MySQL documentation.
9193
9294
:param int client_flag:
9395
flags to use or 0 (see MySQL docs or constants/CLIENTS.py)

0 commit comments

Comments
 (0)