Puzzled by list-appending behavior

Chris Angelico rosuav at gmail.com
Thu May 26 12:04:00 EDT 2011


On Fri, May 27, 2011 at 1:58 AM, MRAB <python at mrabarnett.plus.com> wrote:
> I'd just like to point out that it's a convention, not a rigid rule.
> Sometimes it's not followed, for example, dict.setdefault.

dict.setdefault is more like dict.get but it also stores the result.
It's probably more a name issue than a protocol issue.

Chris Angelico



More information about the Python-list mailing list