From d1fdc37ac9fad1c328c2374297022f715cf24279 Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Thu, 29 Jun 2017 12:05:55 -0500 Subject: Use 'text' instead of 'unicode' --- docs/api/adapter.rst | 9 +++++---- docs/socketexample.rst | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/api/adapter.rst b/docs/api/adapter.rst index 1cfeb8f..33e8491 100644 --- a/docs/api/adapter.rst +++ b/docs/api/adapter.rst @@ -358,7 +358,8 @@ Let's register some adapters first: >>> gsm.registerAdapter(Comp, [None], I5, 'foo') Now we get all the adapters that are registered for ``ob`` that provide -``I5`` (note that on Python 2 the names will be ``unicode``): +``I5`` (note that the names are always text strings, meaning that on +Python 2 the names will be ``unicode``): .. doctest:: @@ -367,10 +368,10 @@ Now we get all the adapters that are registered for ``ob`` that provide >>> [(str(name), adapter.__class__.__name__) for name, adapter in adapters] [('', 'Comp'), ('foo', 'Comp')] >>> try: - ... unicode = unicode + ... text = unicode ... except NameError: - ... unicode = str # Python 3 - >>> [isinstance(name, unicode) for name, _ in adapters] + ... text = str # Python 3 + >>> [isinstance(name, text) for name, _ in adapters] [True, True] Note that the output doesn't include None values. If an adapter diff --git a/docs/socketexample.rst b/docs/socketexample.rst index d6818b3..9e7d7c0 100644 --- a/docs/socketexample.rst +++ b/docs/socketexample.rst @@ -231,15 +231,16 @@ to know about all the adapters that convert a German to a US socket type: entry of the tuple is the name of the adapter and the second is the adapter itself. -Note that the names are ``unicode`` on Python 2: +Note that the names are always text strings, meaning ``unicode`` on +Python 2: .. doctest:: >>> try: - ... unicode = unicode + ... text = unicode ... except NameError: - ... unicode = str - >>> [isinstance(name, unicode) for name, _ in sockets] + ... text = str + >>> [isinstance(name, text) for name, _ in sockets] [True, True, True] -- cgit v1.2.1