Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #9991
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Subject | Re: list(), tuple() should not place at "Built-in functions" in documentation |
| Date | 2011-07-20 16:53 -0400 |
| References | <c420b618-bb1a-4c8f-a446-e33e6e938c93@glegroupsg2000goo.googlegroups.com> <89bfd3a2-e166-425d-99f6-997cc3ab18a5@v11g2000prn.googlegroups.com> <j04bh4$4sl$1@dough.gmane.org> <j05s5e$g6h$1@dough.gmane.org> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1307.1311195192.1164.python-list@python.org> (permalink) |
On 7/20/2011 2:21 AM, Stefan Behnel wrote: > Terry Reedy, 19.07.2011 18:31: >> 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. > > I strongly disagree. Wow. Strongly disagreeing with a mild statement like 'might be useful' is really strong. But let me explain (using slice rather than range). Three of the four non-special attributes of the slice objects produced by the slice() function are the three arguments of the function. (The fourth is an obscure method.) So the function and its result object are closely tied together, and unusually so. Hence it *might* be useful to discuss that particular pair together, especially since both are used rarely and always together. This is a rather minimal concession to the OP. But the overall thrust and conclusion of both that post of mine and the previous one is that 'function' in 'built-in functions' is best understood generically as including objects of type 'type' as well as objects of 'builtin_function_or_method' (and any other built-in callable if there happen to be any). So the rest of your post is strong agreement with what I have said since the beginning of the thread. What one needs to know about range is that it produces a non-iterator re-iterable virtual sequence object that supports a basic subset of the sequence operations. The function belongs in the function chapter and the sequence object in the sequence section of the classes chapter. The OP's point makes more sense in the context of other languages that make an artificial distinction between functions and constructors and require that the latter be preceded by keyword new. I prefer Python's uniformity. -- Terry Jan Reedy
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll 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