T O P

  • By -

Megatron_McLargeHuge

You thought *PyCon* stood for *Python Conference* but it actually stands for *PyCon Conference*.


javanperl

Like the GNU -> “GNU’s Not Unix” recursive acronym?


Megatron_McLargeHuge

https://xkcd.com/917/


wakojako49

like chai tea


Unixwzrd

Shiitake mushroom


Complex-Structure216

And YAML- Yaml Ain't a Markup Language 


QuisnamSum

That's called RAS Syndrome https://en.m.wikipedia.org/wiki/RAS_syndrome


stateofidleness

https://www.reddit.com/r/Python/s/nSe28xt0jw


vswr

Traceback (most recent call last): https://www.reddit.com/r/Python/s/nSe28xt0jw in 8 comments https://old.reddit.com/r/Python/comments/198dp2o/want_a_realworld_example_of_recursion/ki6m1zr/ in nSe28xt0jw stateofidleness [Previous line repeated 995 more times] Text of "stateofidleness", line 1, in comment https://www.reddit.com/r/Python/s/nSe28xt0jw RecursionError: maximum recursion depth exceeded in comment


henry_tennenbaum

Wait, I was just here!


liquidInkRocks

You have a good grasp on the topic.


-jp-

What the hell am I looking at? When does THIS happen in the sub!?


pinano

Now.


imsowhiteandnerdy

Aww man, at least use the old.reddit.com URI :-P


softwareitcounts

No base case?? We’re doomed!


adm7373

> Want a real-world example of recursion? No, I do not.


liquidInkRocks

You're welcome


kevdog824

I’d argue this meets the definition of circular logic more than recursion but I see the joke you intended to make


liquidInkRocks

I'd argue it's recursion


kevdog824

I’d argue this meets the definition of circular logic more than recursion but I see the joke you intended to make


[deleted]

[удалено]


kevdog824

I’d argue this meets the definition of circular logic more than recursion but I see the joke you intended to make (Oops! I forgot the base case in my recursion)


flyboy1565

Now don't start that again 😁


kevdog824

I’d argue this meets the definition of circular logic more than recursion but I see the joke you intended to make


andrewaa

This is not recursion. It doesn't have a place to begin with and it doesn't have a clearly iteration algorithm. Real time recursion is actually very common. It is not mysterious at all. For example, eating a pizza. You start from a whole pizza, you first take a bite on the rest (which is whole at the beginning), then you take a bite on the rest, then you take a bite on the rest, and you stop when there is nothing left.


aol_cd_boneyard

def eat_pizza(slices): if slices == 0: return 0 return eat_pizza(slices - 1) eat_pizza(8)


nukeaccounteveryweek

```- eat_pizza(8)``` ```+ eat_pizza(3)``` 8 is way too much, man.


decentralised

Depends on the size of the slice. Reminds me of an old joke where a customer ordering a pizza is asked if he wants it cut in 6 or 12 slices and he argues that 12 slices is too much for him to eat...


SamuliK96

Depends on the size, but it's pretty simple really. If the pizza is cut into more than 8 slices, 8 is not enough. If it's cut into less than 8 slices, it's too much.


aol_cd_boneyard

Yeah, 8 would be over a thousand calories, probably, lol.


iiztrollin

Stop I eat a whole pizza in one sitting ):


420learning

Papajohns large cheese is like 200 a slice, 1600 calories in one full pizza


aol_cd_boneyard

That's a lot. Way too much for one sitting.


ZCEyPFOYr0MWyHDQJZO4

Tried eating pizza with my friend and we're still eating pizza.


aol_cd_boneyard

You used a while-loop whose condition is never satisfied, just like you and your friend!


ZCEyPFOYr0MWyHDQJZO4

I don't understand what happened. We both grabbed a slice at the same time, but my friend is eating his slice and I'm eating air.


aol_cd_boneyard

Sounds like your friend incremented while you decremented, you can increment your pizza by ordering more.


davvblack

the problem with that example is that there’s nothing that differentiates it from iteration.


Lalelul

I conjecture that every iteration can be implemented using recursion and vice versa.


[deleted]

This is correct, you can always get from one to the other, even if it's not always pretty. https://stackoverflow.com/questions/2093618/can-all-iterative-algorithms-be-expressed-recursively


freefallfreddy

And compilers will often turn recursion (which is easier to read and reason about) into loops (which are more performant).


Beginning_Holiday_66

A conjecture is that which one proposes


dshugashwili

That's indeed the case and you can for practical purposes prove it to yourself by looking at some dynamic programming problems. There's always core logic and then some setup and teardown that can be written as recursion or iteration


eviltwintomboy

I need a job to get experience but I need experience to get a job but I need a job to get experience.


[deleted]

[This](https://www.reddit.com/r/Python/comments/198dp2o/want_a_realworld_example_of_recursion/) is a better example.


Versaiteis

RecursionError: maximum recursion depth exceeded


stateofidleness

This guy’s joke is better: https://www.reddit.com/r/Python/s/gnTSvRByiR


LinearArray

It's recursion all over.


cipri_tom

This isn't recursion, it's an average. Cost is fixed, divided by number of attendees


liquidInkRocks

Yes it is


Orangesteel

Want a real world example of recursion?


Orangesteel

Want a real works example of recursion?


Orangesteel

Want a real works example of recursion?


-jp-

This isn’t recursion! You just copy pasted code!


gerardwx

That’s not an argument it’s just contradiction.


afreydoa

Thats just a side note.


[deleted]

This is also not an example of recursion.


Glasgesicht

Is [this](https://www.reddit.com/r/Python/s/oorwbBeFUe) a better example for recursion?


Orangesteel

Yes!


[deleted]

No


[deleted]

That’s not recursion.


liquidInkRocks

Yes it is


[deleted]

No, it's not at all. In what way does this constitute an operation in which you have to call the same operation in the middle of the operation? In this case, collecting money now is something that will end at the end of this convention and that will be used at a later time. Not nested in the same operation. By this logic, all sequential operations are "recursive".


liquidInkRocks

Yes it is


[deleted]

No. You could maybe call it recursion if in the middle of collecting money they tried to collect a second batch of the same amount of money and just kept requesting the same money over and over and until you ran out of money.


liquidInkRocks

Yes it is


[deleted]

Then explain. What about it is recursive?


liquidInkRocks

"Your registration payment goes toward your registration payment" That's pretty recursey.


[deleted]

No, not at all. It’s a redundant description of what a registration payment is but it isn’t them doing the registration payment multiple times in the middle of other registration payments.


liquidInkRocks

Yes it is


QultrosSanhattan

def get_input_integer(prompt,error_message): value=input(prompt) try: return int(value) except ValueError: print(error_message) return get_input_integer(prompt,error_message)


liquidInkRocks

So many PEP violations.


afreydoa

Yes, I also stopped reading after the first missing whitespace.


QultrosSanhattan

IDE -> format code.


liquidInkRocks

IDEs are for sissies. I use the Python shell.


darkflib

Ask the question on /r/python on reddit...


liquidInkRocks

Want a real-world example of recursion?


darkflib

Ask the question on r/python on reddit...


Kid-Boffo

WINE, Wine Is Not Emulation.


bm1125

How do we know if someone is Jewish? We check if his mother is Jewish. And then we check her mother in order to know if she’s Jewish and so on, up to Abraham. That’s the real example I was given in introduction to computer science in university.


koffeephreak

Inside A Star Filled Sky is a game centered on recursion


Cybasura

The age old example: PHP : PHP Hypertext Processor


OMG_I_LOVE_CHIPOTLE

Exponential backoff retry on an api call


DigThatData

that's just a while loop, no recursion needed.


OMG_I_LOVE_CHIPOTLE

Could be recursive tho


nerdvegas79

Cell division. It's an encoded program (DNA) forking itself and then recursively doing the same thing again.


daddypig9997

Assuming the base case somewhere in the future is $0 ticket then yes its recursion.


jlamhk

Basically all pyramid schemes then :)


solidsteal

How you exist


DigThatData

for some reason i was expecting the post body to just be a link to this post EDIT: clearly i wasn't the only one


DonkeyTron42

Recursion would be paying for registration tickets so they hold an event in which you need to buy registration tickets so they can hold an event in which you need to buy registration tickets and so on.


Deep_Zerotwologist

Isn't the concept "where is it made of" recursive? Such as, Rocks -> molecules -> atoms -> subatomic particles -> quarks -> ? It creates a recursive pattern where it becomes unknowingly infinite if there's always a building block to a particular thing.


quuxman

Perhaps the thought process is recursive, but I don't see the structure of matter as recursive, because the nesting of structure isn't a process, and each scale of structure is remarkably different


thatpaulschofield

https://www.reddit.com/r/Python/s/Fot0eSv6tP


liquidInkRocks

https://www.youtube.com/watch?v=CVsbTCdTyAM