Re: Instance method for converting int to str - str() and __str__()

2015-10-03 Thread Terry Reedy
On 10/3/2015 2:35 AM, neubyr wrote: I was wondering if there is any resource that explains why certain methods like str() and type() These are classes. Calling a class calls the class construction and initialization functions. These return an instance of the class. While reading the

Re: Instance method for converting int to str - str() and __str__()

2015-10-03 Thread Steven D'Aprano
On Sat, 3 Oct 2015 04:35 pm, neubyr wrote: > I was wondering if there is any resource that explains why certain methods > like str() and type() were implemented the way they are, rather than > .to_string() or .type() instance/object methods. There is a FAQ that might help with this question:

Instance method for converting int to str - str() and __str__()

2015-10-03 Thread neubyr
I was wondering if there is any resource that explains why certain methods like str() and type() were implemented the way they are, rather than .to_string() or .type() instance/object methods. I find instance/object methods more intuitive for this cases, but I am wondering why it wasn't

Re: Instance method for converting int to str - str() and __str__()

2015-10-03 Thread Laura Creighton
In a message of Fri, 02 Oct 2015 23:35:28 -0700, neubyr writes: >I was wondering if there is any resource that explains why certain methods >like str() and type() were implemented the way they are, rather than >.to_string() or .type() instance/object methods. > >I find instance/object methods more