50
thealex
6y

When you tell students to use functions...

Comments
  • 8
    Try a shorter version:

    def all_lines(input):
    return all_lines(input)
  • 1
    @ruhe That would be too obvious, they needed the assignment to trick me into believing that the function does something 😀
  • 5
    @ruhe Isn't that endless recursion? Lol.
  • 3
    @BigBoo but .. but it returns all_lines
  • 1
    @ruhe And does that forever. Practical.
  • 0
    @PrivateGER that's a very philosophical question.
    Does it return all_lines countless times or does it return not at all?
  • 1
    @ruhe It's not philosophical. The function has to be evaluated before returning. So it will just deepdive and go bye bye.
  • 0
    @ruhe it'll return something eventually, but that'll be a stack overflow
  • 0
    not used to python but isnt that just a setter that also returns the resulting state? could be useful... if the assignment of all_lines is somehow changing the data... the function/variable names are confusing as hell though.
Add Comment