News for hackers. Stuff that matters.
Re:Pope tempted by Python. Signs off on coding scheme for kids by 3PS on Saturday October 28, 2023 @07:15PM (#38054372)
I know I'm taking a joke comment WAY too seriously, but... that "else" branch is unreachable, right?
Re:Pope tempted by Python. Signs off on coding scheme for kids by Shish2k on Saturday October 28, 2023 @07:26PM (#38054448)
Correct (in a `try ... else` the else branch is executed when the try block reaches the end of the block with no exception, and the return is leaving the block without reaching the end)

(Bonus context for anyone surprised that it is valid code — Python actually allows you to use “else” in more places than you’d expect - `for ... else` is my favourite (do a for loop over a list of things, `break` if you find the thing that you’re looking for, and then the `else` branch will be taken if you don’t find what you’re looking for. Much cleaner than keeping track of a separate i_found_the_thing bool IMO))

Re:Pope tempted by Python. Signs off on coding scheme for kids by froh on Saturday October 28, 2023 @07:25PM (#38054441)
that's right, and absolutely make sense, as the church meanwhile realized unbaptized babies don't go to limbo but to heaven.
Re:Pope tempted by Python. Signs off on coding scheme for kids by warble on Saturday October 28, 2023 @07:23PM (#38054420)
Depends on the exception. Maybe the sun wasn't moral.