On 2/11/07, Ben North <[EMAIL PROTECTED]> wrote: [SNIP] > * The draft currently allows a two-argument form, to supply a default > value if the object has no attribute of that name. This mimics the > behaviour of the three-argument form of getattr, but looks a bit wrong: > > s = obj.(attr_name, 'default string') > > I agree that it looks odd, but perhaps the extra expressive power > gained might be worth the oddness.
I don't think it is. getattr can just be kept around if need be in order to support this use case. It just makes it look like too much of a function call at that point to me, especially if someone ends up writing some expression that is so long that they put in a newline between the two values: s = obj.(attr_name, 'default_string') So -1 on the two-item version, +0 on the one-item version. -Brett _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com