Python docs disappointing

P

Paul Boddie

All the above not withstanding, I too think a wiki is worth
trying.  But without doing a lot more than just "setting up
a wiki", I sadly believe even a python.org supported wiki
is doomed to failure.

The ones on python.org seem to function reasonably well. I accept that
they could be more aggressively edited, but this isn't done because
there's a compromise between letting people contribute and keeping
things moderately coherent, with the former being favoured. For other
purposes, it would be quite acceptable to favour editorial control.

I won't argue that providing infrastructure solves a problem - that's
precisely the kind of thing I was criticising when I noted that some
people will readily criticise the choice of tools to do a job instead
of focusing on the job that has to be done - and you need people who
are reasonably competent editors, but Wiki solutions remove a lot of
technical barriers. I'm not arguing for the flavour of Wiki which
implies unfettered, anonymous access from everyone on the Internet,
either: the kind of Wiki that detractors portray all Wiki solutions as
being in order to further their super-special "it has to fit like a
glove or it's totally unusable" software agenda. It's quite possible
to have people with somewhat more privileges than others in order to
keep the peace, and they don't all need to have an entrenched
editorial interest: on the current python.org Wiki sites, most of the
administrators don't have an active interest in most of the content,
but they are able to exercise control when it's clear that some
contributors aren't particularly interested in actually improving the
content.

As well as having an active community effort around the existing
python.org Wiki sites, there are also people who are interested in
improving these offerings. What worries me is that despite such
activity and such interest, many people will continue to lament the
lack of vitality (or whatever other metric) of the general python.org
offering, whilst retaining a blind spot for the obvious contribution
that the Wikis can make to such improvement efforts. I encourage
people to use wiki.python.org a lot more, should they be looking to
improve the wealth of information provided by the community.

Paul
 
S

Steven D'Aprano

Huh? I don't buy this at all. Code refactoring doesn't change the
semantics of the program at all -- it simplifies the code that
implements behavior without changing behavior. How does this apply to
revising documentation?

My apologies, I mis-wrote. Of course refactoring is inappropriate in this
context. What I meant was a major redesign where the API may change.

Except of course that documentation changes don't need to be concerned
with backwards compatibility, except possibly to avoid breaking old links.


[...]
I'm confused. If they weren't overworked, then they would approve
patches they didn't see a need for?

No.

If they're overworked, they're less likely to spend time investigating
patches which aren't immediately obvious that they're needed.

And additionally, if the patch doesn't appear to be useful, it's unlikely
to be approved. Why would it be?

Or are you saying because they are
overworked they fail to approve patches that should be approved?

Invariably there will be good patches missed because they haven't been
noticed.

I am
not sure how either supports the argument that the tracker is the best
method of improving the docs.

These are not arguments in favour of the tracker, these are realistic
issues that any project of non-trivial size have to deal with. Virtually
every project (not just software projects either) have to deal with the
fact that there will be more things to do than resources to do them with.


[...]
Has there ever been a PEP for a doc change? Are you making a serious
suggestion?

I don't know if there ever has been, but as far as I know, there are two
ways to get changes approved to Python: informal approval by somebody
with check-in privileges, or formal approval on the basis of a PEP. If
you can't get the first, then the second is an option, albeit unlikely.


I just looked through the first 70 or so messages in this thread and in
this case I have agree with you, most of the responses were not what I
called "standard responses". There was one guy, a Steven D'Aprano early
on that trotted out the, "it's free software, fix it if you don't like
it" line,

And I stand by it. If you're not helping to solve the problem, then what
exactly are you doing?

Even if you can't provide a patch, provide a bug report. What
specifically is wrong with the docs? Be specific. Give examples. Explain
why it is wrong. State your assumptions, e.g. what audience do you
represent?

If you do these things, you're helping. If you're just complaining, then
you're not.

You have been told repeatedly why your insistence that the tracker must
be the only channel, is wrong. I don't understand why you can't
understand that.

(Generally only those in authority, bosses, parents, police, and the
like, "tell" others what a situation is and have a right to demand that
the subject accept it without question. I think you could find a more
respectful and less authoritarian way of phrasing what you said above
since you are not in a position of authority over me.)

"You're not my real dad!!!"

In the words of Jesse "The Body" Venture, I'm just telling it like it is.
The tracker is the only practical way of getting doc changes accepted,
for those without check-in privileges or the ear of someone with them. Me
telling you this is no more an expression of authority than me telling
you that the USA has 50 states.

Of course I could be wrong. My understanding of the facts might be wrong,
or I may not be in full possession of all the relevant facts. If so, I
welcome correction.

So please tell me, what other practical ways are there for an
unprivileged person to get the official Python docs modified?
 
R

RJ

A basic question in this thread is: Who will host the
doc-wiki/whatever and how will it be linked to?
If not hosted at python.org it can still be linked to from their
docs, if allowed, possibly with 3rd level domain and re-direct.
I host a number of commercial servers but I don't expect Guido to
bless them with said links.
If hosted at python.org it will require resources from the existing admins.
If elsewhere then trusted admins and organization.
If not linked to from python.org then it may well expire from lack of
interest, as other seemingly nice attempts did.

Ray Schumacher
 
B

Bill Jones

Kee said:
As someone trying to learn the language I want to say that the tone on
this list towards people who are trying to learn Python  feels like it
has become anti-newbies.
[snip]

Kee Nethery

My gut feeling (which could of course be wrong) is that many hard core
Pythonistas are cheesed off with newbies who refuse to help themselves.

The funny thing is that their response is to shutdown changes that are
intended
to *help* newbies help themselves. It seems self-defeating to me.
 
C

Carl Banks

The funny thing is that their response is to shutdown changes that are
intended
to *help* newbies help themselves. It seems self-defeating to me.

Intended to help newbies doesn't necessarily mean it actually will
help newbies.

(Just sayin'.)


Carl Banks
 
M

Mark Lawrence

Bill said:
Kee said:
As someone trying to learn the language I want to say that the tone on
this list towards people who are trying to learn Python feels like it
has become anti-newbies. [snip]

Kee Nethery
My gut feeling (which could of course be wrong) is that many hard core
Pythonistas are cheesed off with newbies who refuse to help themselves.

The funny thing is that their response is to shutdown changes that are
intended
to *help* newbies help themselves. It seems self-defeating to me.
And I still do not believe this to be true. Documents are being changed
all the time. See the python-dev mailing list "Summary of python
tracker issues" dated 17/24/31 July and 07/14 August 2009. The only
request I recall being rejected is someone objecting to the use of
"weapons" in a piece of sample code.

Also see Issue6660 on the bug tracker, it is of particular interest to
anyone who's interested in plans for python.org documentation links.
 
X

Xah Lee

Thanks Raymond.

I've been out of python community for a couple of years. I've saved
your messages and will study it later when next time i work in python.
Possibly today and will reply in some of your points.

But just wanted to say thanks for improving python.

Also, sometimes ago out of the blue i noticed someone has posted a bug
on python's gzip doc with acknowledgement. http://bugs.python.org/issue2406

Thank you M.-A. DARCHE (madarche).

Also, i noticed python doc now and later has improved a lot since last
i looked around python 2.4. For one thing, the html/xhtml is now valid
html. Good riddence of the fucking TeX. Also, code examples have
syntax coloring on.

Xah
∑ http://xahlee.org/

☄


[Xah Lee]
i've wrote several articles about this issue, total time spend on this
is probably more than 2 months full-time work. See:

I just read you post. You did devote a substantial amount of time
to the project. Some of your criticisms are valid. Wish you had
posted patches, I think many of them would have been accepted.

Since you wrote this a few years ago, many examples have
been added to the docs and more are forthcoming.
I often receive thank you emails for 2 particular articles, which are
most frequently google searched as indicated by my weblog:
• Python Doc Problem Example: sort()
http://xahlee.org/perl-python/python_doc_sort.html

Some are the criticisms are valid; others seem off-base.

Here are a few thoughts on list.sort() for those who are interested:

* The key= and reversed= parameters are not intended for special
cases, leaving cmp= for the general case. They were intended to
be full replacements. In Python3.x, the cmp function is gone.

* The interaction of the key= and cmp= functions can be made to
interact (the key function is first applied to every element and
the cmp function then gets applied to the results of the key
function). This isn't a normal or intended use case, so the docs
don't delve into the subject.

* The reversed parameter does more than list.sort() followed by
list.reverse(). It also preserves stability in the event of equal
keys:
sorted([(1,2), (1,3)], key=itemgetter(0), reverse=True)
[(1,2), (1,3)]

So it was not correct to say that the following are equivalent:

li.sort(lambda x, y: cmp(x[1],y[1]), reverse=True)
li.sort(lambda x, y: cmp(y[1],x[1]))

* We should link the sorted() and list.sort() docs to the
sorting how-to (with a fuller discussion on the art of sorting
including a discussion of operator.itemgetter() and
operator.attrgetter() which were designed to work with the key=
parameter.

Raymond
 
X

Xah Lee

[Xah Lee]
i've wrote several articles about this issue, total time spend on this
is probably more than 2 months full-time work. See:

I just read you post. You did devote a substantial amount of time
to the project. Some of your criticisms are valid. Wish you had
posted patches, I think many of them would have been accepted.

Since you wrote this a few years ago, many examples have
been added to the docs and more are forthcoming.
I often receive thank you emails for 2 particular articles, which are
most frequently google searched as indicated by my weblog:
• Python Doc Problem Example: sort()
http://xahlee.org/perl-python/python_doc_sort.html

Some are the criticisms are valid; others seem off-base.

Here are a few thoughts on list.sort() for those who are interested:

* The key= and reversed= parameters are not intended for special
cases, leaving cmp= for the general case. They were intended to
be full replacements. In Python3.x, the cmp function is gone.

* The interaction of the key= and cmp= functions can be made to
interact (the key function is first applied to every element and
the cmp function then gets applied to the results of the key
function). This isn't a normal or intended use case, so the docs
don't delve into the subject.

* The reversed parameter does more than list.sort() followed by
list.reverse(). It also preserves stability in the event of equal
keys:
sorted([(1,2), (1,3)], key=itemgetter(0), reverse=True)
[(1,2), (1,3)]

So it was not correct to say that the following are equivalent:

li.sort(lambda x, y: cmp(x[1],y[1]), reverse=True)
li.sort(lambda x, y: cmp(y[1],x[1]))

* We should link the sorted() and list.sort() docs to the
sorting how-to (with a fuller discussion on the art of sorting
including a discussion of operator.itemgetter() and
operator.attrgetter() which were designed to work with the key=
parameter.
Here are a few thoughts on list.sort() for those who are interested:

After one more reading of Xah Lee's posts on the documentation for
sort,
here are couple more thoughts:

* The reason that list.sort() allows None for the cmp parameter is not
so that you can write list.sort(None). It was put there to make it
easier for people writing function definitions where the cmp function
is a possible argument:

def sort_and_chop(seq, maxlen, cmp=None):
s = seq[:]
s.sort(cmp) # needs to accept None as a possible
argument
return s[:maxlen]

* The reason for implementing the key= parameter had nothing to do
with limitations of Python's compiler. Instead, it was inspired by
the
decorate-sort-undecorate pattern.

Hi Raymond,

thanks for the many points. They are informative, some i disagree, but
it's getting into detail. I don't know python 3.0, will have to look
into its sort in the future.

This part i don't particular agree:
* The reason for implementing the key= parameter had nothing to do
with limitations of Python's compiler. Instead, it was inspired by
the
decorate-sort-undecorate pattern.

The decorate-sort-undecorate pattern is a compiler limitation, for
most of today's langs. I'm not sure, but i think some of the fancy
functional langs automatically detect such and optimize it away, to
various degrees.

.... my criticism is usually written in a style catered to irritate a
particular class of coder i call tech geekers (they think of themselfs
with their idiotic term “hackersâ€). So, parts are exaggerated. It'd be
more clear to say, that the reason for python's “keyâ€, and as a
“solution†or need of the decorate-sort-undecorate issue, can be
attributed to the current state of the art of popular imperative
language's compilers (induced by such lang's semantics).

again, i haven't studied python 3.0 to see what it has changed with
sort, and thanks for the informative post. I find it intriguing that
it doesn't have “cmp†anymore as you say.... maybe when i actually
study it and i'll come away with rage and rants. LOL.

Xah
∑ http://xahlee.org/

☄
 
J

Jürgen Exner

Jon Harrop said:
Xah Lee wrote:
[...]

Please do not feed this well-known troll.

He is known to spew some remotely on-topic junk into a bunch of
unrelated NGs and to enjoy the ensuing confusion.

jue
 
P

Paul Rubin

Jon Harrop said:
You mean people use that pattern as a fast alternative in languages where
user-defined functions are very slow, like Python and Mathematica?

It really doesn't matter whether the language is fast or slow--there
are going to be applications where calling the comparison function
multiple times per element is slower than calling it once per element
and storing the result.

Note the Haskell idiom (sortBy (compare`on`f) xs) is similar to DSU
but calls the comparison function multiple times.

Python 3.0 went overboard by actually removing the cmp argument and
requiring use of the key argument. That requires various kludges if
the key is, say, a tree structure that has to be recursively compared
with another such structure. Maybe then can bring back cmp someday.
 
N

Nathan Keel

Jon said:
You mean people use that pattern as a fast alternative in languages
where user-defined functions are very slow, like Python and
Mathematica?


Do not give this "Xah Lee" idiot any attention. This asshole posts only
self-serving nonsense, because he thinks it makes him sound important
(when in reality, he is absolutely clueless). This idiot always cross
posts to 5 or more different groups that have nothing to do with his
attempts to impress people (which always fail). He's incredibly
arrogant, yet incredibly clueless.
 
R

Raymond Hettinger

[Xah Lee]
This part i don't particular agree:


The decorate-sort-undecorate pattern is a compiler limitation, for
most of today's langs. I'm not sure, but i think some of the fancy
functional langs automatically detect such and optimize it away, to
various degrees.

... my criticism is usually written in a style catered to irritate a
particular class of coder i call tech geekers (they think of themselfs
with their idiotic term “hackers”). So, parts are exaggerated. It'd be
more clear to say, that the reason for python's “key”, and as a
“solution” or need of the decorate-sort-undecorate issue, can be
attributed to the current state of the art of popular imperative
language's compilers (induced by such lang's semantics).

I'm not following you here. If you're saying that it is possible
for a compiler to automatically transform a cmp argument into
a key argument, transforming O(n log n) calls into O(n) calls, then
I don't see how that could be done (a cmp argument can be a C function
that is not introspectable or an arbitrarily complex python function
that may be difficult to analyze and transform programmatically).

The key function was introduced as a simpler way for programmers
to write the commonly used decorate-sort-undecorate pattern --
compiler
limitations had nothing to do with it.

In general, key functions are not a terribly new or inflexible
concept.
The SORT BY clauses in SQL are an example.

That being said, it is a fair criticism of Python's compiler that it
does not do much in the way of optimizations. It does a handful of
basic peephole optimizations but that is about it. Other languages
like Haskell fair better in this regard.


Raymond
 
R

rurpy

The ones on python.org seem to function reasonably well. I accept that
they could be more aggressively edited, but this isn't done because
there's a compromise between letting people contribute and keeping
things moderately coherent, with the former being favoured. For other
purposes, it would be quite acceptable to favour editorial control.

Yes, I agree. I should have mentioned this as an exception
in my "wikis suck" diatribe. Although it far better than
most wiki's I've seen, it is still pretty easy to find signs
of typical wiki-ness. On the Documentation page my first
click was on AnnotableDocumentation: 404. Second try,
DoumentationDiscussion: two very short paragraphs dated 2003.
After that I found some useful (in general though not what I
was looking for) information but not a good first impression.
(Well not exactly first, in fairness I have used other wiki
sections such as the Templating page and found them very
useful.)
I won't argue that providing infrastructure solves a problem - that's
precisely the kind of thing I was criticising when I noted that some
people will readily criticise the choice of tools to do a job instead
of focusing on the job that has to be done - and you need people who
are reasonably competent editors, but Wiki solutions remove a lot of
technical barriers. I'm not arguing for the flavour of Wiki which
implies unfettered, anonymous access from everyone on the Internet,
either: the kind of Wiki that detractors portray all Wiki solutions as
being in order to further their super-special "it has to fit like a
glove or it's totally unusable" software agenda. It's quite possible
to have people with somewhat more privileges than others in order to
keep the peace, and they don't all need to have an entrenched
editorial interest: on the current python.org Wiki sites, most of the
administrators don't have an active interest in most of the content,
but they are able to exercise control when it's clear that some
contributors aren't particularly interested in actually improving the
content.

As well as having an active community effort around the existing
python.org Wiki sites, there are also people who are interested in
improving these offerings. What worries me is that despite such
activity and such interest, many people will continue to lament the
lack of vitality (or whatever other metric) of the general python.org
offering, whilst retaining a blind spot for the obvious contribution
that the Wikis can make to such improvement efforts. I encourage
people to use wiki.python.org a lot more, should they be looking to
improve the wealth of information provided by the community.

Again, I agree with all of that. But my main interest is
in improving the standard docs that are distributed with
Python and I question a wiki's role in that.

I took a look at the PHP docs last night which seem
pretty well done. The User Comments looked rather as I
expected, there was useful info but most did not contain
documentation quality writing. So if they are used as
a source for improving the docs, there clearly must be a
pretty large amount of editorial effort required, although
much of it is probably just filtering out comments that
don't provide any information appropriate for inclusion
in the docs. They list 38 names under "User Note Maintainers"
(http://www.php.net/manual/en/preface.php)
Unfortunately I couldn't find a description of what these
people actually do. I don't know how much work was involved
in removing the comments that are no longer there.

Again, I don't mean to sound like I am dissing the idea
of annotatable docs -- I think it is a good idea and will
provide useful supplementary information.

But I continue to question whether this will result in
improvements in the docs themselves (which is my main
interest) unless:

1. The purpose of the wiki is clearly "marketed" as
soliciting suggestions, rewrites, etc destined ultimately
for inclusion in the docs.

2. There is a dedicated core of doc-competent volunteers
focused on extracting, condensing and editing the user
comments and getting them into the docs, either directly
(if the volunteers are committers -- unlikely) or through
the existing tracker system. And this still fails to
address the problems with the docs that aren't amenable
to fixing via the tracker system. At least two of those
problems are:
1. Difficultly in making large organizational changes.
2. Prevalent opinion among doc approvers that the current
excessively terse style is desirerable.
 
T

Terry Reedy

Nathan said:
idiot ... asshole
absolutely clueless ... idiot ...incredibly
arrogant, yet incredibly clueless.

To me, such name-calling is as obnoxious as the intended target.

tjr
 
S

Steven D'Aprano

Python 3.0 went overboard by actually removing the cmp argument and
requiring use of the key argument. That requires various kludges if the
key is, say, a tree structure that has to be recursively compared with
another such structure. Maybe then can bring back cmp someday.

I'm having trouble understanding this, which may be my weakness rather
than yours, but could you give an actual (simplified?) example I can run,
where cmp would work but key wouldn't?
 
P

Paul Boddie

Yes, I agree.  I should have mentioned this as an exception
in my "wikis suck" diatribe.  Although it far better than
most wiki's I've seen, it is still pretty easy to find signs
of typical wiki-ness.  On the Documentation page my first
click was on AnnotableDocumentation: 404.

Well, "Annotatable Documentation" is an external link. All we can do
in such cases is to tidy such stuff up, mark it as invalid, or remove
it.
 Second try, DoumentationDiscussion: two very short paragraphs dated 2003.

Right. There are parts of the Wiki which were used actively in the
past but which have fallen into disrepair. Some pages lack focus -
they've been created according to "old school" Wiki conventions which
I regard as being somewhat obsolete (just creating new pages all over
the place to cover whatever happens to be in the writer's head at the
time) - and every now and again, I attempt to rationalise these pages
and focus their content.
After that I found some useful (in general though not what I
was looking for) information but not a good first impression.
(Well not exactly first, in fairness I have used other wiki
sections such as the Templating page and found them very
useful.)

It needs work, of course.

[...]
I took a look at the PHP docs last night which seem
pretty well done.  The User Comments looked rather as I
expected, there was useful info but most did not contain
documentation quality writing.  So if they are used as
a source for improving the docs, there clearly must be a
pretty large amount of editorial effort required, although
much of it is probably just filtering out comments that
don't provide any information appropriate for inclusion
in the docs.  They list 38 names under "User Note Maintainers"
(http://www.php.net/manual/en/preface.php)
Unfortunately I couldn't find a description of what these
people actually do.  I don't know how much work was involved
in removing the comments that are no longer there.

Indeed. There's always the editorial bottleneck unless it's a total
free-for-all situation. I've remarked before about how user comments
don't necessarily add significantly to documentation, which is an
assertion that some people make, and there definitely does need to be
a process of integrating the best feedback into the main work. The
crucial difference between a Wiki and an annotation system is the
combination of the contribution and editorial aspects in a Wiki - you
edit the actual work, and people can decide whether it's a good edit
or not - in contrast to their separation in most annotation systems.
In some cases, strict annotation systems are probably better: the
GPLv3 annotation system was oriented towards discussion of the text,
and that's not so effectively done in a Wiki.
Again, I don't mean to sound like I am dissing the idea
of annotatable docs -- I think it is a good idea and will
provide useful supplementary information.

Where there's a separation of annotation and editing, I worry about
the editorial bottleneck. I also worry about "handprint" edits more
generally, where people just want to leave their touch on the work
without actually contributing anything of substance.
But I continue to question whether this will result in
improvements in the docs themselves (which is my main
interest) unless:

   1. The purpose of the wiki is clearly "marketed" as
soliciting suggestions, rewrites, etc destined ultimately
for inclusion in the docs.

I'm happy to see tangential work rather than stuff which fills exactly
the same role as the current documentation. For example, the Python
module of the week articles (PyMOTW, [1]) are exactly the kind of
tangential work that could be encouraged, even though that is not so
much a collaborative work itself.

Paul

[1] http://www.doughellmann.com/PyMOTW/
 
P

Paul Rubin

I took a look at the PHP docs last night which seem pretty well
done. The User Comments looked rather as I expected, there was
useful info but most did not contain documentation quality writing.
So if they are used as a source for improving the docs, there
clearly must be a pretty large amount of editorial effort required,
although much of it is probably just filtering out comments that
don't provide any information appropriate for inclusion in the docs.

The comments section contains questions from users and answers to
those questions from other users. What you may be missing is the part
of the comments useful to the doc maintainers is primarily the user
questions, rather than the user answers. The questions show the doc
writer exactly what parts of the official doc are unclear or
incomplete. The user-written answers may be wrong or generally crap,
but the doc writer now knows what to do to improve the doc. That's
why it's such a win to have the comments on the same page as the
official docs.

See also the user-commented http://book.realworldhaskell.org/read/
where the comments really helped clarify the finished (dead tree) text.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,738
Latest member
TiffinyHol

Latest Threads

Top