spir <denis.spir <at> gmail.com> writes: > > On 12/09/2013 02:29 PM, Wolfgang Maier wrote: > > spir <denis.spir <at> gmail.com> writes: > > > >> > >> Tu sum it up (aha!): you algorithm is the right and only one > > > > No, it's not the only one. It's certainly the most obvious one, but there is > > also the pure numbers approach pointed out by me and Alan. > > You are right in a sense, but this is what int() does, isn't it? So in another
Interesting question! I would assume str() and int() to use a similar algorithm, but I never looked at their actual implementation, so this is just speculation. Also, as a general rule I thought one shouldn't rely on implementation details since they could change (admittedly, quite unlikely for something as basic as this though). > sense I thought it is still the same algo, and it was simpler to present it that > way. But I also agree with your point of view. > > Denis Fair enough. Best, Wolfgang _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor