add doc for urlib, urljoin and cmp

This commit is contained in:
Prodesire 2017-12-07 22:20:56 +08:00
parent 95b8480778
commit 4f9b8565f9
1 changed files with 15 additions and 0 deletions

View File

@ -6,6 +6,16 @@ Compat
Specify current Python interpreter is Python 2 or 3. Specify current Python interpreter is Python 2 or 3.
.. py:function:: pydu.compat.urlib(base, url, allow_fragments=True)
Same to ``urllib`` on PY2 or ``urllib.request`` on PY3.
.. py:function:: pydu.compat.urlparse(base, url, allow_fragments=True)
Same to ``urlparse`` on PY2 or ``urllib.parse`` on PY3.
.. py:function:: pydu.compat.urljoin(base, url, allow_fragments=True) .. py:function:: pydu.compat.urljoin(base, url, allow_fragments=True)
Same to ``urlparse.urljoin`` on PY2 or ``urllib.parse.urljoin`` on PY3. Same to ``urlparse.urljoin`` on PY2 or ``urllib.parse.urljoin`` on PY3.
@ -46,6 +56,11 @@ Compat
Same to ``itertools.imap`` on PY2 or ``map`` on PY3. Same to ``itertools.imap`` on PY2 or ``map`` on PY3.
.. py:function:: pydu.compat.cmp
Same to ``cmp`` on PY2, but implement on PY3.
.. py:function:: pydu.compat.has_next_attr(x) .. py:function:: pydu.compat.has_next_attr(x)
An implementation independent way of checking for next attribute. An implementation independent way of checking for next attribute.