Settings

Theme

Startpoint: A saner replacement for `if __name__ == “__main__”`

github.com

3 points by pavelbr 8 years ago · 4 comments

Reader

earenndil 8 years ago

To be honest, the overhead of getting a library such as this one integrated into a project...isn't worth the overhead or extra time taken over just writing `if __name__ == "__main"`. Yes, having to write that out is shitty, and there should be a better way, but that's the best we have and a librarified solution isn't better, it's missing the point.

  • pavelbrOP 8 years ago

    I thought about this for a while before I published it. In the end, I thought it was neat and didn't see a reason not to.

pavelbrOP 8 years ago

Try it online: https://tio.run/##TU87DsIwDJ3xKQxLGomPEFsFiAFYOQBClQspjdTEUe...

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection