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

2011-07-20 Thread Terry Reedy
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 t

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

2011-07-19 Thread Stefan Behnel
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 use

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

2011-07-19 Thread Terry Reedy
On 7/19/2011 2:52 AM, Raymond Hettinger wrote: On Jul 14, 6:21 pm, Inside 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 ca

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

2011-07-19 Thread Raymond Hettinger
On Jul 14, 6:21 pm, Inside wrote: > 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(), tu

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

2011-07-16 Thread Corey Richardson
Excerpts from Inside's message of Sat Jul 16 01:40:21 -0400 2011: > Supplement: > The assertion will not be handled anyway. > I want AssertionError raise as early as possible.(mentinoed before) An AssertionError is pretty useless, there are much better exceptions that you could (and should!) use,

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

2011-07-15 Thread Inside
Supplement: The assertion will not be handled anyway. I want AssertionError raise as early as possible.(mentinoed before) -- http://mail.python.org/mailman/listinfo/python-list

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

2011-07-15 Thread Inside
> Perhaps you meant this? > > assert isinstance(user, User) Yes I meant this,sorry,my mistake. Thx for your and Ben's feedbacks first,it's appreciated. your points is taken by me,but I want to make my opinion more clearly. The assertion is JUST show to my function call

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

2011-07-15 Thread Steven D'Aprano
Inside wrote: > Why I use assertion,please check this code: > """ > class User(object):pass > > class Student(User):pass > > class Professional(User):pass > > def add(user): > assert(user, User) This does not do what you think it does. All it does is, in some Python versions, print Synta

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

2011-07-15 Thread Chris Angelico
On Sat, Jul 16, 2011 at 5:53 AM, Inside wrote: > def add(users): >    assert(users, (tuple, list)) >    #If necessary I'll also check every obj in the sequence to see whether > it's a User. > > I just follow some coding rules of me: > 1. Controlling "input" strictly. > 2. In a function keep doubt

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

2011-07-15 Thread Stefan Behnel
Terry Reedy, 15.07.2011 05:00: On 7/14/2011 9:51 PM, Ben Finney wrote: Steven D'Aprano writes: Inside wrote: As telling in the subject,because "list" and "tuple" aren't functions,they are types.Is that right? At one time (before 2.2), they were functions and not classes. They are still f

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

2011-07-15 Thread Inside
Why I use assertion,please check this code: """ class User(object):pass class Student(User):pass class Professional(User):pass def add(user): assert(user, User) def add(users): assert(users, (tuple, list)) #If necessary I'll also check every obj in the sequence to see whether it's

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

2011-07-15 Thread Carl Banks
On Thursday, July 14, 2011 8:00:16 PM UTC-7, Terry Reedy wrote: > 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 'b

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

2011-07-15 Thread bruno.desthuilli...@gmail.com
On Jul 15, 9:27 am, "bruno.desthuilli...@gmail.com" wrote: > On Jul 15, 4:58 am, Inside wrote: > > > Hey guy,thx for you feedback first. > > > But I can't follow your opinion.Why?because of the list & tuple are placed > > at built-in function,so before I type 'list' unintentionally on the pyshel

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

2011-07-15 Thread bruno.desthuilli...@gmail.com
On Jul 15, 4:58 am, Inside wrote: > Hey guy,thx for you feedback first. > > But I can't follow your opinion.Why?because of the list & tuple are placed at > built-in function,so before I type 'list' unintentionally on the pyshell and > it show me "", I never know that the name 'list' is a type,I

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

2011-07-14 Thread Chris Angelico
On Fri, Jul 15, 2011 at 11:32 AM, Steven D'Aprano wrote: > Inside wrote: > >> As telling in the subject,because "list" and "tuple" aren't functions,they >> are types.Is that right? > > Yes they are types. But they can still be used as functions. Does it matter? Python is duck-typed, even in its d

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

2011-07-14 Thread Ben Finney
Inside writes: > But I can't follow your opinion.Why?because of the list & tuple are > placed at built-in function,so before I type 'list' unintentionally on > the pyshell and it show me "", I never know that the name > 'list' is a type,I used to consider it's a function to produce 'list' > type.

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

2011-07-14 Thread Terry Reedy
On 7/14/2011 9:51 PM, Ben Finney wrote: Steven D'Aprano writes: Inside wrote: As telling in the subject,because "list" and "tuple" aren't functions,they are types.Is that right? At one time (before 2.2), they were functions and not classes. Yes they are types. But they can still be used

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

2011-07-14 Thread Inside
Hey guy,thx for you feedback first. But I can't follow your opinion.Why?because of the list & tuple are placed at built-in function,so before I type 'list' unintentionally on the pyshell and it show me "", I never know that the name 'list' is a type,I used to consider it's a function to produce

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

2011-07-14 Thread Corey Richardson
Excerpts from rantingrick's message of Thu Jul 14 21:36:15 -0400 2011: > On Jul 14, 8:21pm, Inside wrote: > > 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 fin

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

2011-07-14 Thread Ben Finney
Steven D'Aprano writes: > Inside wrote: > > > As telling in the subject,because "list" and "tuple" aren't functions,they > > are types.Is that right? > > Yes they are types. But they can still be used as functions. Does it matter? As a newcomer to the documentation I looked fruitlessly in the ta

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

2011-07-14 Thread rantingrick
On Jul 14, 8:21 pm, Inside wrote: > 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: [

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

2011-07-14 Thread Steven D'Aprano
Inside wrote: > As telling in the subject,because "list" and "tuple" aren't functions,they > are types.Is that right? Yes they are types. But they can still be used as functions. Does it matter? -- Steven -- http://mail.python.org/mailman/listinfo/python-list