Suggestions

Mark McEahern marklists at mceahern.com
Sat Jan 12 15:43:26 EST 2002


Raymond Hettinger:
> Suggestion #1:   Issue a dubious syntax warning for multiple
> assignments where there are overlaps between the assigned-to
> variables:
>
> >>> a = ['cat','dog']
> >>> i = 1
> >>> i, a[i] = 0, 'boo'
> >>> a
> ['boo', 'dog']        # not ['cat','boo'] which was expected

Suggestion #0:  Avoid using multiple assignments unless you know what you're
doing.

;-)

// mark





More information about the Python-list mailing list