127
u/potato-rotator Dec 03 '19
53
u/luc122c Dec 03 '19
Good bot. I think.
27
u/DrMeepster Dec 04 '19
!isbot u/potato-rotator
69
u/IntactBurrito Dec 04 '19
u/potato_rotator has a 97% chance of being a bot.
Out of 6453 comments, 6426 were either duplicates or were atleast 90% identical to other comments.
I am not a bot, I made that all up.
30
11
4
u/DeedleFake Dec 04 '19
+/u/User_Simulator IntactBurrito
6
u/User_Simulator Dec 04 '19
TRIANGLE NET r/catfruit please can we get a release date for animal crossing game, happy home designer!
~ IntactBurrito
2
2
3
1
79
u/acidicraccoon18 Dec 03 '19
Infinite nice?
25
u/Cutlesnap Dec 03 '19
I'm guessing about two billion times?
31
10
u/acidicraccoon18 Dec 03 '19
I've never used python but if once x gets so negative it loops itll be 2 - whatever that number is
3
13
u/valzargaming Dec 03 '19 edited Dec 03 '19
This will loop approximately 2147483650 times before an underflow to positive.
47
u/Badel2 Dec 03 '19
No, this is python, we don't do that here. Integers can get as big or as small as you want. unless you are using numpy or some other library which is essentially a wrapper around c code, then the library may return incorrect results
11
u/Yanitsko97 Dec 03 '19
Infinite integers?
8
7
u/Astrokiwi Dec 04 '19
Once integers get too big, python repackages them into a "BigInt" type, which is basically several integers in a trenchcoat.
2
u/Yanitsko97 Dec 04 '19
Damn that‘s awesome. I‘m used to Java so this sounds like magic to me:p
5
u/Astrokiwi Dec 04 '19
The tricky bit is those big integers are a lot slower than raw integers, and it won't warn you when it switches to them. It also means that there's one less warning sign if you have a bug that gives you huge numbers by accident. This is the trade-off of the "just handle it" versus "die gracefully" conundrum.
You can do BigIntegers in Java though, you just have to do it manually.
2
42
u/NahroT Dec 03 '19
nice
0
Dec 03 '19
[deleted]
8
Dec 03 '19
nice
1
Dec 03 '19
nice
0
u/jzoller0 Dec 03 '19
nice
9
24
u/_lxgan Dec 03 '19
The real issue here is using IDLE
8
3
u/BananaGuyBill Dec 03 '19
Nah TextEdit is where it’s at
6
2
u/ChildOfACabbage Dec 03 '19
Notepad
3
u/-_______-_-_______- Dec 04 '19
What's wrong with notepad? I'll have you know, it's the best IDE available.
4
u/ChildOfACabbage Dec 04 '19
I'll have you know that notepad is not the best IDE. The best one is to carve your code directly into granite caverns.
37
10
3
u/shinydewott Dec 03 '19
But why?
3
u/unfunny_joker Dec 03 '19
Why not tho?
25
Dec 03 '19
Because you could just:
while true: print(‘69’)19
8
2
u/xt1zer Dec 04 '19
I don't know how types values ranges work in python, but if that was C, the code would still make sense, because once an integer reaches its minimal value and then you subtract one, its value will revert to maximum, thus the while loop is finite
3
u/YourVibe Dec 03 '19
Not really, because it's not really an infinite loop
while True: print('69') would truly work infinitely
Loop from the image won't end with integer overflow, like you might expect (because there is no such like overflow thing in python), but will eventually crash because of Out of memory error.
4
Dec 03 '19 edited Dec 03 '19
Well if his goal is to end up with Out of memory exception, then it’s still gonna be shorter:
x=0 while 1: x-=11
3
Dec 03 '19 edited Dec 03 '19
The funny parts are the unnecessary variable assignments and decrementing. Initializing x with 0 is still less than 10.
3
2
3
1
u/walterbanana Dec 03 '19
Is that Notepad?
3
Dec 03 '19
No, look at the app icon. Also, since when has Notepad ever had syntax highlighting or even rich text?
1
Dec 04 '19
You can barely see the icon.....
2
Dec 04 '19
With what you can see, does any part of it match this?
0
Dec 04 '19
No. Do you see an IDLE icon?
2
Dec 04 '19
I’m done. I can’t argue with stupidity.
1
1
1
1
1
1
u/CallOfCrutches Dec 04 '19
True programmers don't write shitty numbers like 69, only 42. Except that the code is fine.
1
1
1
1
u/Sparkplug1034 Dec 03 '19
Not infinite sex number. Only integer underflow sex number. I know this because I accidentally wrote nested for-loops yesterday where I incremented the bound instead of the iterator.
12
u/_PM_ME_PANGOLINS_ Dec 03 '19
Python numbers don’t underflow.
1
Dec 03 '19
.NET dev, integers can overflow and cause an overflow exception when adding to an integer at its max value which can be either positive or negative. I’m not a Python dev but I am interested in knowing if the compiler does the same, and if not, how does it handle it?
3
u/jigggles Dec 03 '19
Python integers are objects and have no statically alocated memory. They just take as much memory as they need to store their value. So their maximum value is only given by the memory available and they don't over/underflow. Once the number gets too big, the interpreter runs out of memory and the program stops with a MemoryError. But it will take a many magnitudes larger number than 2 billion.
2
u/oxetyl Dec 03 '19
There is no int max or min. Python integers grow into the positive or negative forever without bound
-1
Dec 03 '19
I can now see why Python is slow. That’s a lot of work for a processor to do. Seems like the compiler is doing a lot of under the hood trickery and conversions to get that to work.
1
u/oxetyl Dec 03 '19
Python is relatively slow, but in this case, cant the interpreter just check whether the new integer can fit in the amount of allocated bytes, and if not, add another byte(s)?
0
Dec 03 '19
[deleted]
67
u/rickybflay Dec 03 '19
Came here to write that I feel like this does exactly what it's supposed to do.
47
u/archpawn Dec 03 '19
But they could have just used
while True: print('69')33
u/kkjdroid Dec 04 '19
But this way, it eventually runs you out of RAM.
14
u/cutreaper Dec 04 '19
Thats a long eventually though lmao. Also TIL python doesnt have int over/underflow. But to take up any significant portion of RAM by decrementing that will probably take longer than the heat death of the universe.
7
u/the_monkey_of_lies Dec 04 '19
I can totally see someone working on this machine on the post heat death universe, in a government organization that hasn't upgraded their system for billions of years and suddenly running out of RAM for no apparent reason.
4
u/botle Dec 04 '19
Why would it run out of RAM? I'm not too familiar with Python, but in C it wouldn't happen.
8
u/hiimsoba Dec 04 '19
Simply put, x will get smaller and smaller, and it will take up more and more RAM to be represented in memory. Python has no limits for the number values, unlike C. Correct me if I'm wrong. :)
5
6
u/kkjdroid Dec 04 '19
When a number gets too big (or in this case, small) for its container to hold, Python just makes it a bigger container instead of wrapping around like C does.
2
Dec 05 '19
I think the goal was for people to have the code on their screens for as long as possible.
Hence overcomplication.
0
279
u/Plus_Cryptographer Dec 03 '19
Why did you make the picture like it would fit in a shitty advertisement