_unquote

Jon Ribbens jon+usenet at unequivocal.eu
Sun Aug 4 19:18:05 EDT 2019


On 2019-08-04, Hongyi Zhao <hongyi.zhao at gmail.com> wrote:
> See the following code excerpted from https://github.com/shichao-an/
> homura/blob/master/homura.py:
>
> ---
> def unquote(s):
>     res = s
>     if not PY3:
>         if isinstance(res, six.text_type):
>             res = s.encode('utf-8')
>     return _unquote(res)
> ---
>
> I'm very confused on the  `_unquote' used above?  What's the meaning of 
> it?  I cannot find its definition from the python's shipped packages.

It isn't from Python's library. You need to look higher up in the file
you mention in order to find where it's imported:

    from six.moves.urllib.parse import urlparse, unquote as _unquote

So it's 'six.moves.urllib.parse.unquote'... Look up the package 'six'
on pypi to find its documentation: https://pypi.org/project/six/



More information about the Python-list mailing list