From 6de8255cb8078dbc8db63c82487cb393ce6b8552 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 05:50:31 -0800 Subject: Remove *_types per b1a257bacc1c4ac2c1401ed02c51d9c6c03685d2 - Remove Python 2 items, and remove explicit mention of Python 3. --- docs/api/compat.rst | 84 +++++++++++++---------------------------------------- 1 file changed, 20 insertions(+), 64 deletions(-) (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst index bb34f38e4..b54b4868a 100644 --- a/docs/api/compat.rst +++ b/docs/api/compat.rst @@ -12,145 +12,101 @@ systems which require compatibility imports. .. autofunction:: ascii_native_ - .. attribute:: binary_type - - Binary type for this platform. For Python 3, it's ``bytes``. For - Python 2, it's ``str``. - .. autofunction:: bytes_ - .. attribute:: class_types - - Sequence of class types for this platform. For Python 3, it's - ``(type,)``. For Python 2, it's ``(type, types.ClassType)``. - .. attribute:: configparser - On Python 2, the ``ConfigParser`` module, on Python 3, the - ``configparser`` module. + The ``configparser`` module. .. function:: escape(v) - On Python 2, the ``cgi.escape`` function, on Python 3, the - ``html.escape`` function. + The ``html.escape`` function. .. function:: exec_(code, globs=None, locs=None) - Exec code in a compatible way on both Python 2 and 3. + Exec code. .. attribute:: im_func - On Python 2, the string value ``im_func``, on Python 3, the string - value ``__func__``. + The string value ``__func__``. .. function:: input_(v) - On Python 2, the ``raw_input`` function, on Python 3, the - ``input`` function. - - .. attribute:: integer_types - - Sequence of integer types for this platform. For Python 3, it's - ``(int,)``. For Python 2, it's ``(int, long)``. + The ``input`` function. .. function:: is_nonstr_iter(v) - Return ``True`` if ``v`` is a non-``str`` iterable on both Python 2 and - Python 3. + Return ``True`` if ``v`` is a non-``str``. .. function:: iteritems_(d) - Return ``d.items()`` on Python 3, ``d.iteritems()`` on Python 2. + Return ``d.items()``. .. function:: itervalues_(d) - Return ``d.values()`` on Python 3, ``d.itervalues()`` on Python 2. + Return ``d.values()``. .. function:: iterkeys_(d) - Return ``d.keys()`` on Python 3, ``d.iterkeys()`` on Python 2. + Return ``d.keys()``. .. attribute:: long - Long type for this platform. For Python 3, it's ``int``. For - Python 2, it's ``long``. + Long type ``int``. .. function:: map_(v) - Return ``list(map(v))`` on Python 3, ``map(v)`` on Python 2. + Return ``list(map(v))``. .. attribute:: pickle ``cPickle`` module if it exists, ``pickle`` module otherwise. - .. attribute:: PY3 - - ``True`` if running on Python 3, ``False`` otherwise. - .. attribute:: PYPY ``True`` if running on PyPy, ``False`` otherwise. .. function:: reraise(tp, value, tb=None) - Reraise an exception in a compatible way on both Python 2 and Python 3, - e.g. ``reraise(*sys.exc_info())``. - - .. attribute:: string_types - - Sequence of string types for this platform. For Python 3, it's - ``(str,)``. For Python 2, it's ``(basestring,)``. + Reraise an exception ``reraise(*sys.exc_info())``. .. attribute:: SimpleCookie - On Python 2, the ``Cookie.SimpleCookie`` class, on Python 3, the ``http.cookies.SimpleCookie`` module. .. autofunction:: text_ - .. attribute:: text_type - - Text type for this platform. For Python 3, it's ``str``. For Python - 2, it's ``unicode``. - .. autofunction:: native_ .. attribute:: urlparse - ``urlparse`` module on Python 2, ``urllib.parse`` module on Python 3. + ``urllib.parse`` .. attribute:: url_quote - ``urllib.quote`` function on Python 2, ``urllib.parse.quote`` function - on Python 3. + ``urllib.parse.quote`` .. attribute:: url_quote_plus - ``urllib.quote_plus`` function on Python 2, ``urllib.parse.quote_plus`` - function on Python 3. + ``urllib.parse.quote_plus`` .. attribute:: url_unquote - ``urllib.unquote`` function on Python 2, ``urllib.parse.unquote`` - function on Python 3. + ``urllib.parse.unquote`` .. attribute:: url_encode - ``urllib.urlencode`` function on Python 2, ``urllib.parse.urlencode`` - function on Python 3. + ``urllib.parse.urlencode`` .. attribute:: url_open - ``urllib2.urlopen`` function on Python 2, ``urllib.request.urlopen`` - function on Python 3. + ``urllib.request.urlopen`` .. function:: url_unquote_text(v, encoding='utf-8', errors='replace') - On Python 2, return ``url_unquote(v).decode(encoding(encoding, errors))``; - on Python 3, return the result of ``urllib.parse.unquote``. + Return the result of ``urllib.parse.unquote``. .. function:: url_unquote_native(v, encoding='utf-8', errors='replace') - On Python 2, return ``native_(url_unquote_text_v, encoding, errors))``; - on Python 3, return the result of ``urllib.parse.unquote``. + Return the result of ``urllib.parse.unquote``. -- cgit v1.2.3 From e6beded7543305b47ef7bc2ba8a0d9ff76ceb5b1 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 05:52:12 -0800 Subject: Remove pickle and exec aliases --- docs/api/compat.rst | 8 -------- 1 file changed, 8 deletions(-) (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst index b54b4868a..c3816f8e9 100644 --- a/docs/api/compat.rst +++ b/docs/api/compat.rst @@ -22,10 +22,6 @@ systems which require compatibility imports. The ``html.escape`` function. - .. function:: exec_(code, globs=None, locs=None) - - Exec code. - .. attribute:: im_func The string value ``__func__``. @@ -58,10 +54,6 @@ systems which require compatibility imports. Return ``list(map(v))``. - .. attribute:: pickle - - ``cPickle`` module if it exists, ``pickle`` module otherwise. - .. attribute:: PYPY ``True`` if running on PyPy, ``False`` otherwise. -- cgit v1.2.3 From 4863dfea9783c11e70f1604415dbc32c12d59ac6 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 05:55:07 -0800 Subject: Remove iter*, configparser, input_, map_ --- docs/api/compat.rst | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst index c3816f8e9..f647c3108 100644 --- a/docs/api/compat.rst +++ b/docs/api/compat.rst @@ -14,10 +14,6 @@ systems which require compatibility imports. .. autofunction:: bytes_ - .. attribute:: configparser - - The ``configparser`` module. - .. function:: escape(v) The ``html.escape`` function. @@ -26,34 +22,14 @@ systems which require compatibility imports. The string value ``__func__``. - .. function:: input_(v) - - The ``input`` function. - .. function:: is_nonstr_iter(v) Return ``True`` if ``v`` is a non-``str``. - .. function:: iteritems_(d) - - Return ``d.items()``. - - .. function:: itervalues_(d) - - Return ``d.values()``. - - .. function:: iterkeys_(d) - - Return ``d.keys()``. - .. attribute:: long Long type ``int``. - .. function:: map_(v) - - Return ``list(map(v))``. - .. attribute:: PYPY ``True`` if running on PyPy, ``False`` otherwise. -- cgit v1.2.3 From f84582524b625265ad379e41513770aefe7c6dcd Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 05:56:42 -0800 Subject: Remove SimpleCookie and escape shims --- docs/api/compat.rst | 8 -------- 1 file changed, 8 deletions(-) (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst index f647c3108..e25290c37 100644 --- a/docs/api/compat.rst +++ b/docs/api/compat.rst @@ -14,10 +14,6 @@ systems which require compatibility imports. .. autofunction:: bytes_ - .. function:: escape(v) - - The ``html.escape`` function. - .. attribute:: im_func The string value ``__func__``. @@ -38,10 +34,6 @@ systems which require compatibility imports. Reraise an exception ``reraise(*sys.exc_info())``. - .. attribute:: SimpleCookie - - ``http.cookies.SimpleCookie`` module. - .. autofunction:: text_ .. autofunction:: native_ -- cgit v1.2.3 From 5f59fb7db454e47e9845d74ec2b04e581beca574 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 05:57:06 -0800 Subject: Remove reraise --- docs/api/compat.rst | 4 ---- 1 file changed, 4 deletions(-) (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst index e25290c37..6f94ea2d4 100644 --- a/docs/api/compat.rst +++ b/docs/api/compat.rst @@ -30,10 +30,6 @@ systems which require compatibility imports. ``True`` if running on PyPy, ``False`` otherwise. - .. function:: reraise(tp, value, tb=None) - - Reraise an exception ``reraise(*sys.exc_info())``. - .. autofunction:: text_ .. autofunction:: native_ -- cgit v1.2.3 From 087dc33696b81235468e80b93ee7eee510d40d8e Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 05:57:30 -0800 Subject: Remove is_nonstr_iter --- docs/api/compat.rst | 4 ---- 1 file changed, 4 deletions(-) (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst index 6f94ea2d4..25b81addc 100644 --- a/docs/api/compat.rst +++ b/docs/api/compat.rst @@ -18,10 +18,6 @@ systems which require compatibility imports. The string value ``__func__``. - .. function:: is_nonstr_iter(v) - - Return ``True`` if ``v`` is a non-``str``. - .. attribute:: long Long type ``int``. -- cgit v1.2.3 From c2fabed4dceb33c655a498583841769aa78bebbf Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 06:00:19 -0800 Subject: Remove urllib.parse shims --- docs/api/compat.rst | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst index 25b81addc..d8a4d0cbb 100644 --- a/docs/api/compat.rst +++ b/docs/api/compat.rst @@ -29,36 +29,3 @@ systems which require compatibility imports. .. autofunction:: text_ .. autofunction:: native_ - - .. attribute:: urlparse - - ``urllib.parse`` - - .. attribute:: url_quote - - ``urllib.parse.quote`` - - .. attribute:: url_quote_plus - - ``urllib.parse.quote_plus`` - - .. attribute:: url_unquote - - ``urllib.parse.unquote`` - - .. attribute:: url_encode - - ``urllib.parse.urlencode`` - - .. attribute:: url_open - - ``urllib.request.urlopen`` - - .. function:: url_unquote_text(v, encoding='utf-8', errors='replace') - - Return the result of ``urllib.parse.unquote``. - - .. function:: url_unquote_native(v, encoding='utf-8', errors='replace') - - Return the result of ``urllib.parse.unquote``. - -- cgit v1.2.3 From 8b7705f27a6ecc47742ec743de0ced7e8a15eb17 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 06:05:42 -0800 Subject: Remove native_, rename ascii_native_ to ascii_ --- docs/api/compat.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst index d8a4d0cbb..f05bdd51b 100644 --- a/docs/api/compat.rst +++ b/docs/api/compat.rst @@ -10,7 +10,7 @@ systems which require compatibility imports. .. automodule:: pyramid.compat - .. autofunction:: ascii_native_ + .. autofunction:: ascii_ .. autofunction:: bytes_ @@ -27,5 +27,3 @@ systems which require compatibility imports. ``True`` if running on PyPy, ``False`` otherwise. .. autofunction:: text_ - - .. autofunction:: native_ -- cgit v1.2.3 From 1662edc38e145fa820544fb3aad91ab86e3185da Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 17 Nov 2018 06:07:44 -0800 Subject: Remove long type (should have been removed with other type aliases) --- docs/api/compat.rst | 4 ---- 1 file changed, 4 deletions(-) (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst index f05bdd51b..d1552e644 100644 --- a/docs/api/compat.rst +++ b/docs/api/compat.rst @@ -18,10 +18,6 @@ systems which require compatibility imports. The string value ``__func__``. - .. attribute:: long - - Long type ``int``. - .. attribute:: PYPY ``True`` if running on PyPy, ``False`` otherwise. -- cgit v1.2.3 From fe1740acba6a9bfe5ac3aed41a9a264a9fd30814 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 18 Nov 2018 05:22:54 -0800 Subject: Remove `docs/api/compat.rst`. The remaining items were moved into `pyramid.util`, but we don't want to document anything in that module. --- docs/api/compat.rst | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 docs/api/compat.rst (limited to 'docs/api') diff --git a/docs/api/compat.rst b/docs/api/compat.rst deleted file mode 100644 index d1552e644..000000000 --- a/docs/api/compat.rst +++ /dev/null @@ -1,25 +0,0 @@ -.. _compat_module: - -:mod:`pyramid.compat` ----------------------- - -The ``pyramid.compat`` module provides platform and version compatibility for -Pyramid and its add-ons across Python platform and version differences. APIs -will be removed from this module over time as Pyramid ceases to support -systems which require compatibility imports. - -.. automodule:: pyramid.compat - - .. autofunction:: ascii_ - - .. autofunction:: bytes_ - - .. attribute:: im_func - - The string value ``__func__``. - - .. attribute:: PYPY - - ``True`` if running on PyPy, ``False`` otherwise. - - .. autofunction:: text_ -- cgit v1.2.3