How Does requests.get Work?

Abdur-Rahmaan Janhangeer arj.python at gmail.com
Thu Apr 2 02:27:52 EDT 2020


Ah i get it

from .api import request, get, head, post, patch, put, delete, options

Whatever you import in __init__.py, you can access it directly. Thanks!

Kind Regards,

Abdur-Rahmaan Janhangeer
compileralchemy.com <https://www.compileralchemy.com> | github
<https://github.com/Abdur-rahmaanJ/>
Mauritius


On Thu, Apr 2, 2020 at 10:15 AM Chris Angelico <rosuav at gmail.com> wrote:

> On Thu, Apr 2, 2020 at 5:12 PM Abdur-Rahmaan Janhangeer
> <arj.python at gmail.com> wrote:
> >
> > When dev a package, if you can do:
> >
> > >>> from package import x
> >
> > does not mean you can do
> >
> > >>> import package
> > >>> package.x
> >
> > for requests i was wondering how requests package can have
> >
> > >>> requests.get
> >
> > while requests is defined in api.py
> >
>
> Did you have a look at __init__.py?
>
> https://github.com/psf/requests/blob/master/requests/__init__.py
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>


More information about the Python-list mailing list