summaryrefslogtreecommitdiff
path: root/docs/api/compat.rst
blob: b54b4868a04fa9d8da0eadd940e1c33e1e0bcc00 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
.. _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:: configparser

      The ``configparser`` module.

   .. function:: escape(v)

      The ``html.escape`` function.

   .. function:: exec_(code, globs=None, locs=None)

      Exec code.

   .. attribute:: im_func

      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:: pickle

       ``cPickle`` module if it exists, ``pickle`` module otherwise.

   .. attribute:: PYPY

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

   .. function:: reraise(tp, value, tb=None)

      Reraise an exception ``reraise(*sys.exc_info())``.

   .. attribute:: SimpleCookie

      ``http.cookies.SimpleCookie`` module.

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