Re: [Tutor] A Million Sevens

2006-11-24 Thread Andreas Kostyrka
* Chris Hengge <[EMAIL PROTECTED]> [061119 00:44]: > That must be part of Pythons shiny ability of dynamic data types? Must be a > messy operation to change data-types like that.. I think I'll just do my > best to work with the right data-types the whole time ;D Well, huge miss understanding: a =

Re: [Tutor] A Million Sevens

2006-11-18 Thread Chris Hengge
That must be part of Pythons shiny ability of dynamic data types? Must be a messy operation to change data-types like that.. I think I'll just do my best to work with the right data-types the whole time ;D On 11/18/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "Chris Hengge" <[EMAIL PROTECTED]> wro

Re: [Tutor] A Million Sevens

2006-11-18 Thread Alan Gauld
"Chris Hengge" <[EMAIL PROTECTED]> wrote > Not that it changes your reply, but just for my own sanity: > int('7' * 10 ** 6) <- does this not just type-cast a char into an > int? Chris, I suspect you may come from a C background? Type *conversion* in Python is very differentb from type *casting*

Re: [Tutor] A Million Sevens

2006-11-17 Thread Luke Paireepinart
Chris Hengge wrote: > Not that it changes your reply, but just for my own sanity: > int('7' * 10 ** 6) <- does this not just type-cast a char into an int? it typecasts a 1,000,000 character long string to an integer. > > Meaning that rather then consuming 1024k as you stated, it would > consume 20

Re: [Tutor] A Million Sevens

2006-11-17 Thread Thomas
On 18/11/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > Not that it changes your reply, but just for my own sanity: > int('7' * 10 ** 6) <- does this not just type-cast a char into an int? > > Meaning that rather then consuming 1024k as you stated, it would consume > 2048k at the peak of the calcul

Re: [Tutor] A Million Sevens

2006-11-17 Thread Alan Gauld
Tim, Every now and then you pop up on the tutor list to answer "interesting" posts like this: "Tim Peters" <[EMAIL PROTECTED]> wrote > That much does /only/ the decimal-string -> large binary integer > part. > Don't display i until the next step. For display, it's /enormously/ > faster to conve

Re: [Tutor] A Million Sevens

2006-11-17 Thread Chris Hengge
Not that it changes your reply, but just for my own sanity: int('7' * 10 ** 6) <- does this not just type-cast a char into an int? Meaning that rather then consuming 1024k as you stated, it would consume 2048k at the peak of the calculation(2bytes per char? * 1m = 2048k) then typecasting to int w

Re: [Tutor] A Million Sevens

2006-11-17 Thread Tim Peters
[Thomas] > Earlier today I typed the following into my pythonwin interactive > interpreter in windows xp: > > >>> int('7' * 10 ** 6) > > I expected either an error message Unlikely, if your box has enough RAM to run WinXP :-) > or it to get stuck and require me to stop the process manually. Not

Re: [Tutor] A Million Sevens

2006-11-17 Thread Collin Hockey
A mildly educated guess would be that python tried to access memory Windows wasn't going to allow it to have, effectively causing a BSOD and making Windows restart the system. Thomas wrote: > Earlier today I typed the following into my pythonwin interactive > interpreter in windows xp: > >

Re: [Tutor] A Million Sevens

2006-11-17 Thread Luke Paireepinart
Chris Hengge wrote: > I'm thinking you either have a problem with a memory leak (my memory > isn't changing, just at 100% CPU), or your CPU overheated from poor > cooling since it is at 100% utilization. yeah I second this... there's no reason why this would reboot your computer. At Chris: It's b

Re: [Tutor] A Million Sevens

2006-11-17 Thread Chris Hengge
I'm thinking you either have a problem with a memory leak (my memory isn't changing, just at 100% CPU), or your CPU overheated from poor cooling since it is at 100% utilization. On 11/17/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Well, I dont get the point.. its not locking up my system or any

Re: [Tutor] A Million Sevens

2006-11-17 Thread Chris Hengge
Well, I dont get the point.. its not locking up my system or anything.. its just crunching away... even while I type this... I guess your point is that it should stop since a 32 bit O/S can only count to: 4,294,967,296 On 11/17/06, Thomas <[EMAIL PROTECTED]> wrote: Earlier today I typed the fol

[Tutor] A Million Sevens

2006-11-17 Thread Thomas
Earlier today I typed the following into my pythonwin interactive interpreter in windows xp: int('7' * 10 ** 6) I expected either an error message or it to get stuck and require me to stop the process manually. I read that unlike long integers in C, longs in python are only limited by the amo