Re: [Tutor] ReadableInt

2016-12-30 Thread Steven D'Aprano
On Fri, Dec 30, 2016 at 04:46:26PM +, Albert-Jan Roskam wrote: > Hi, > > > Why does the call to str() below return '1' and not 'one'? Because the literals 1, 2, 3 etc are hard-coded in the interpreter to return objects of type `int`. Shadowing the name in the builtins module doesn't chang

Re: [Tutor] ReadableInt

2016-12-30 Thread eryk sun
On Fri, Dec 30, 2016 at 4:46 PM, Albert-Jan Roskam wrote: > > Remember I only intend to use it while debugging the given script. Have you tried hooking sys.displayhook? > Why does the call to str() below return '1' and not 'one'? Should I implement > __new__ > because int is immutable? You can

[Tutor] ReadableInt

2016-12-30 Thread Albert-Jan Roskam
Hi, Why does the call to str() below return '1' and not 'one'? Should I implement __new__ because int is immutable? I have a datafile that contains values and an associated metadata file with the associated labels. I need to recode the values. Because just using the values is a bit error prone