if <assignment>:

maney at pobox.com maney at pobox.com
Thu Nov 28 11:11:20 EST 2002


Dave Brueck <dave at pythonapocrypha.com> wrote:
> On Wed, 27 Nov 2002 maney at pobox.com wrote:
>> On the contrary, the only time the lack of (explicit) assignment in
>> expression has bothered me the issue was *horizontal* space.
> 
> Can you give an example please?

Been there, did that.  In brief, it arose from a simple alternation in
looking for matches to a set of regexes in a string.  The result of the
regex's application was needed both as the conditional test and within
the body of the conditional clause.  The simple and straightforward
implementation added a level of indentation for each case because the
elif had to become

        else:
            m = re_4.match(...)
            if m:
                ... code for record type 4

Yes, there are a number of ways to work around this.  They all feel
more or less like kluges, and they all have their pros and cons. 
Please do NOT start that discussion again here.

>>  It also sounds as though you could be confusing a desire for concise
>> expression with a much sillier objective - at least it seems so entirely
>> silly to me that I can't really take it seriously.  Of course it's much
>> easier to defeat a silly, contrived argument.  :-/
> 
> Sorry, I have no idea what this means.

Refuting the desire for operator= on the grounds that saving a little
horizontal space is unimportant sounded rather like you had setup a
straw man the better to have an easy, assured victory.  I suppose it's
possible that there was context that I've overlooked (or never saw as
context for your post - I'm still coming to grips with the way the
mailing list side of this forum breaks threading sometimes), but that
seems such a silly argument as not to need refutation.  Perhaps it's a
matter of taste.



More information about the Python-list mailing list