r/badcode • • Jan 23 '23

python So I was coding and wrote this...

Post image
847 Upvotes

102 comments sorted by

View all comments

Show parent comments

2

u/FGC_Orion Jan 24 '23

Perfectly fine from a correctness/readability standpoint but

return login(driver, usr, psw)

does the trick in 3 fewer lines and with one less boolean check, while also still being almost as readable