While python doesn't explicitly allow do-while loops, there are at least 3 reasonable ways to implement them:
1)
while True:
#loop body
if not expr():
break
2)
x = True
while x:
#loop body
x = expr()
3)
def f():
#loop body
f()
while expr():
f()
Not to mention other methods mentioned here (e.g. coroutines, try-except clauses, iterators, etc), that I assume are non-pythonic under most conditions. I even see some answers arguing that do-while loops are non-pythonic, but I don't know a generic alternative.
Which method is most pythonic? They all have their oddity: 1) begins with an infinite loop, 2) creates a opaque variable at first, and 3) defines a new function. Does anyone have a better method?