summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2017-06-29 12:05:55 -0500
committerJason Madden <jamadden@gmail.com>2017-06-29 12:05:55 -0500
commitd1fdc37ac9fad1c328c2374297022f715cf24279 (patch)
tree6d982d7c15eceefb8c793b1ba8c2e32c1abc353a /docs
parent891ada316770d5c60a7124beb1a1e589483c8ccf (diff)
downloadzope-component-d1fdc37ac9fad1c328c2374297022f715cf24279.tar.gz
Use 'text' instead of 'unicode'
Diffstat (limited to 'docs')
-rw-r--r--docs/api/adapter.rst9
-rw-r--r--docs/socketexample.rst9
2 files changed, 10 insertions, 8 deletions
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]