stOneskull

stOneskull.xyz

  • 1 Post
  • 6 Comments
Joined 1 year ago
cake
Cake day: June 28th, 2023

help-circle


  • stOneskulltoPythondonno2048/pygoto: Use goto in Python
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 year ago

    i’ve found a good alternative is returning functions

    eg. you have a function like this:

    def cycle(func): while True: func=func()

    then you start with cycle(main)

    def main(): return intro

    if __name__ == '__main__: cycle(main)

    and then main returns the next function, and following functions return functions…

    def intro(): if thisthing: return thisfunc if thatthing: return thatfunc

    return is being used like goto






  • stOneskulltoPythonWelcome to c/Python!
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    1 year ago

    i wonder what python version should be recommended as standard? should it be what debian stable currently has as its lastest? i’ve found some things can’t handle the new-ness of 3.11. so is it 3.10?