[Python-Dev] The socket HOWTO
solipsis at pitrou.net
Sun Jun 5 12:33:13 CEST 2011
On Sun, 05 Jun 2011 08:32:38 +0200
"Martin v. Löwis" <martin at v.loewis.de> wrote:
> >> -1. I think there should be a Python-oriented introduction to sockets.
> >> You may have complaints about the specific wording of the text, but
> >> please understand that these are probably irrelevant to most
> >> first-time readers of this text. My observation is that people actually
> >> don't read the text that much, but instead try to imitate the examples.
> > So what you're saying is that the text is mostly useless (or at least
> > quite dispensable), but you think it's fine that people waste their
> > time trying to read it?
> No, that's not what I said. I said the people actually *don't* read
> the text, so they won't waste time with it. They only glance at the
> text, enough to understand the examples.
I'm sorry, that sounds like a very outlandish argument to make.
Did you run a user survey?
If people only "glance at the text", then what is the text for?
Why not kill the text and rename the page "socket examples" so that
there is no misunderstanding and so that we don't waste time
trying to maintain (and argue about) it?
> > I'm not sure why the examples are good (for example, modern client
> > code should probably use create_connection() with a host name, not
> > connect()).
> I disagree. create_connection is an advanced function - you shouldn't
> be using it unless you know what it is doing.
Can you explain? I would certainly use it myself, and I don't
understand how it's "advanced". It's simply higher-level.
Actually, we've been actually replacing uses of connect() with
create_connection() in various parts of the stdlib, so that our
client modules get IPv6-compatible.
> No no no no no. Absolutely not.
> a) telling people who want to learn sockets "don't learn sockets,
> learn some higher-level library" is besides the point. What do
> you tell them when they did that, and now come back to learn
You said yourself that the HOWTO doesn't claim to explain sockets, so
how can you make such a point now? If people want to learn sockets for
real, the HOWTO is hopeless for them.
> I'd happily kill the entire non-blocking discussion from the tutorial
> if it hurts you as much as it hurts me.
More information about the Python-Dev