Another and possibly more succinct way to write your patch follows:
and (which == 'both' or which == 'changelogs'):
vs
and which in ['both', 'changelogs']:
Another and possibly more succinct way to write your patch follows:
and (which == 'both' or which == 'changelogs'):
vs
and which in ['both', 'changelogs']: