Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #9886

Re: list(), tuple() should not place at "Built-in functions" in documentation

From Terry Reedy <tjreedy@udel.edu>
Subject Re: list(), tuple() should not place at "Built-in functions" in documentation
Date 2011-07-19 12:31 -0400
References <c420b618-bb1a-4c8f-a446-e33e6e938c93@glegroupsg2000goo.googlegroups.com> <89bfd3a2-e166-425d-99f6-997cc3ab18a5@v11g2000prn.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1256.1311093108.1164.python-list@python.org> (permalink)

Show all headers | View raw


On 7/19/2011 2:52 AM, Raymond Hettinger wrote:
> On Jul 14, 6:21 pm, Inside<fancheyuj...@gmail.com>  wrote:
>> As telling in the subject,because "list" and "tuple" aren't
>> functions,they are types.Is that right?

They are not instances of a class whose definition name includes the 
word 'Function'. They *are* things that can be called with the call 
operator () (because they have __call__ methods) and that, when called, 
map input objects to output objects. That is the mathematical notion of 
a function. It is also one thing that makes classes different from 
modules, which cannot be called. Classes *also* have other behaviors 
that functions do not, but that does not make them non-functions. Doing 
things besides programming Python does not make one not a Python programmer.

> 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.

The location of anything (that is not missing from the index, which is a 
bug) is easily discovered using the index.

> A simple fact of documentation that is that tools don't always fall
> cleanly into distinct categories.

This is more like a fact of life above the atomic level. As the number 
of things classified grows, most classifications tend to become 
controversial.

>  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. For others, 
like int, instances come from many sources and the behavior of instances 
only depends on the resulting value and not the source. Ints can come 
from literals, computation, and int calls with int, other number, or 
string objects. The allowed argument issues for int calls are quite 
separate from using int, so it really belongs in C.2.

I agree that it is best to list all named built-in classes in C.2 with 
appropriates links to C.5 (and v.v.). There is a current tracker issue 
to add the few links that are missing from C.2 to C.5.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

list(),tuple() should not place at "Built-in functions" in documentation Inside <fancheyujian@gmail.com> - 2011-07-14 18:21 -0700
  Re: list(),tuple() should not place at "Built-in functions" in documentation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-15 11:32 +1000
    Re: list(),tuple() should not place at "Built-in functions" in documentation Ben Finney <ben+python@benfinney.id.au> - 2011-07-15 11:51 +1000
      Re: list(), tuple() should not place at "Built-in functions" in documentation Terry Reedy <tjreedy@udel.edu> - 2011-07-14 23:00 -0400
      Re: list(), tuple() should not place at "Built-in functions" in documentation Stefan Behnel <stefan_ml@behnel.de> - 2011-07-15 23:03 +0200
    Re: list(), tuple() should not place at "Built-in functions" in documentation Chris Angelico <rosuav@gmail.com> - 2011-07-15 16:24 +1000
  Re: list(),tuple() should not place at "Built-in functions" in documentation rantingrick <rantingrick@gmail.com> - 2011-07-14 18:36 -0700
    Re: list(), tuple() should not place at "Built-in functions" in documentation Corey Richardson <kb1pkl@aim.com> - 2011-07-14 22:01 -0400
  Re: list(),tuple() should not place at "Built-in functions" in documentation Raymond Hettinger <python@rcn.com> - 2011-07-18 23:52 -0700
    Re: list(), tuple() should not place at "Built-in functions" in documentation Terry Reedy <tjreedy@udel.edu> - 2011-07-19 12:31 -0400
    Re: list(), tuple() should not place at "Built-in functions" in documentation Stefan Behnel <stefan_ml@behnel.de> - 2011-07-20 08:21 +0200
    Re: list(), tuple() should not place at "Built-in functions" in documentation Terry Reedy <tjreedy@udel.edu> - 2011-07-20 16:53 -0400

csiph-web