FAQ

Tino Lange a ?crit :
I just realized that <dict>.setdefault *always* executes the second
argument - even if it's not necessary, because the requested item in
the first argument exists.
Since setdefault is a method, this is coherent with Python's standard
behaviour: method and function arguments are always evaluated before the
method is called.

--
Alexandre Fayolle
LOGILAB, Paris (France).
http://www.logilab.com http://www.logilab.fr http://www.logilab.org
D?veloppement logiciel avanc? - Intelligence Artificielle - Formations

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 8 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedJul 31, '03 at 4:35p
activeAug 1, '03 at 1:06a
posts8
users6
websitepython.org

People

Translate

site design / logo © 2022 Grokbase