[Tutor] For-else... Any other handy constructs hiding in Python?

Alex Hall ahall at autodist.com
Fri Jun 24 09:07:27 EDT 2016


Hey all,
I was looking at how to make my different jobs retry themselves, and found
the for-else construct. I know loops, comprehensions, ifs, and the like,
but I never knew for-else was available. Are there other constructs that I
may have missed--shortcuts or seemingly odd pairings of control statements
like this? Python has a lot of really cool shortcuts and features, like
get/hasattr, the yield keyword, or comprehensions. I always like finding
more to add to the toolbox.

-- 
Alex Hall
Automatic Distributors, IT department
ahall at autodist.com


More information about the Tutor mailing list