On Tue, Feb 8, 2022 at 1:31 AM Marc-Andre Lemburg <m...@egenix.com> wrote:

> FWIW: I find this discussion a bit strange. Python's stdlib is
> supposed to provide basic tooling for a breadth of use cases,
> with emphasis on "basic" and "breadth".
>
> urllib is such a basic library and covers one of the main
> use cases for Python we have.


Exactly. However, it is also a bit of an "attractive nuisance". For
example, there is a lot of code in some of my major projects that use
urllib for more complex cases, where we'd be much better off with requests,
or ...

Yes, that's mainly the result of our team's atrocious lack of code review,
but this code was written by smart productive people.

The fact is that the stdlib is the first place folks look for stuff, and if
what you are looking for is there, then many people won't think: "maybe
there's a better, and well supported, package on PyPi for this"

So my thoughts:

Rather than deprecate urllib, we refactor it a bit (and maybe deprecate
parts of it), so that it:

1) contains the core building blocks: e.g. urllib.parse with which to build
"better" libraries,

2) make the "easy stuff easy" -- e.g. a basic http: request.
- For instance, I'd like to see an API that's kind of "requests-lite"

And much better docs explain when you should use it, and when you might
want to look for another library (even if it's the stdlib http.client)

I note that I don't see any discussion of that in urllib dics, whereas
http.client does have the suggestion front and center that you might want
to use requests.

Yes, the web moves fast, but it's also pretty backward compatible - folks
keep old browsers around for an astonishingly long time! So I'd think
cPython release Cycle shold be able to keep up with all but the very latest.

> make Python less attractive and less useful for beginners.

On this point, I'm not so sure -- the first thing I do for beginners is to
point them to requests, as it's easier to use :-) -- but see my point
above, that's why it would be good to put an easy-to-use-for-the-basics API
in the stdlib

-CHB


-- 
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/FLU522SFBBSMMXHRDBXYYGXD3IQ2CD6K/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to