From 4f9b8565f919b60f2913fae938445e5fb02fe8d1 Mon Sep 17 00:00:00 2001 From: Prodesire Date: Thu, 7 Dec 2017 22:20:56 +0800 Subject: [PATCH] add doc for urlib, urljoin and cmp --- docs/compat.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/compat.rst b/docs/compat.rst index 8d4ee60..54c3cb2 100644 --- a/docs/compat.rst +++ b/docs/compat.rst @@ -6,6 +6,16 @@ Compat 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) 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. +.. py:function:: pydu.compat.cmp + + Same to ``cmp`` on PY2, but implement on PY3. + + .. py:function:: pydu.compat.has_next_attr(x) An implementation independent way of checking for next attribute.