I am working on mechanize with python.
The
Improving a bit on python412524's example, the documentation states that this is valid as well, and I find it a bit cleaner:
for form in br.forms(): if form.attrs['id'] == 'sblock': br.form = form break