summaryrefslogtreecommitdiff
path: root/docs/api/compat.rst
blob: 6f94ea2d4448af2c03f02724d9fb3510fc370e90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.. _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_native_

   .. autofunction:: bytes_
        
   .. attribute:: im_func

      The string value ``__func__``.

   .. function:: is_nonstr_iter(v)

      Return ``True`` if ``v`` is a non-``str``.

   .. attribute:: long

      Long type ``int``.

   .. attribute:: PYPY

      ``True`` if running on PyPy, ``False`` otherwise.

   .. 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``.