I
Inside
As telling in the subject,because "list" and "tuple" aren't functions,they are types.Is that right?
Inside said:As telling in the subject,because "list" and "tuple" aren't functions,they
are types.Is that right?
As telling in the subject,because "list" and "tuple" aren't functions,they are types.Is that right?
As telling in the subject,because "list" and "tuple" aren't functions,they are types.Is that right?
You wanna see some warts in the docs. Okay, try to use the search box
to find list, dict, or tuple and see what happens...
http://docs.python.org/
Search: [ list ]
PyMethod_ClearFreeList (cfunction, in Method Objects)
[ snip: mile long list with no LIST info to be found! ]
Hey don't get me wrong, the python docs are great; as long as you know
where to find what you're looking for.
As a newcomer to the documentation I looked fruitlessly in the table of
contents for a section that would contain the built-in types. “Built-in
functions†was eliminated for the reason the OP states.
I think it matters. (But I haven't proposed a documentation patch for it.)
Yes they are types. But they can still be used as functions. Does it matter?
At one time (before 2.2), they were functions and not classes.
I once proposed, I believe on the tracker, that 'built-in functions' be
expanded to 'built-in function and classes'. That was rejected on the basis
that people would then expect the full class documentation that is in the
'built-in types' section (which could now be called the built-isssn classes
section.
A more exact title would be 'built-in callables', but that would be even
less helpful to newcomers. Callables are functions in the generic sense.
In any case, the new index makes it easy to see what is in that chapter.
As telling in the subject,because "list" and "tuple" aren't functions,they are types.Is that right?
list() and tuple() are in the right place in the documentation
because they would be harder to find if listed elsewhere. Tools
like str(), int(), list(), tuple() etc tend to be used like
functions, so the current location in the docs is where they have
been for years.
A simple fact of documentation that is that tools don't always fall
cleanly into distinct categories.
Accordingly, the Library Reference
includes str,int,list,tuple, etc in both Section 2 for
builtin functions and Section 5 for builtin types.
Chapter 5 is mostly about the behavior of built-in class instances. For
some classes, like range, instances only come from class calls and the
behavior of instances is intimately tied to the constructor arguments.
Having the constructor described in C.5 might be useful.
Terry Reedy, 19.07.2011 18:31:
I strongly disagree.
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.