PEP 312 - Making lambdas implicit worries me, surely it's just the name 'lambda' that is bad...

Alex Martelli aleax at aleax.it
Thu Mar 13 06:54:55 EST 2003


Stephen Horne wrote:
   ...
>>> I don't really see the relevance of the fact that "'lambda' never
>>> starts a line". Other frequently used words (such as built-in function
>>> names) also never start a line - 'reduce' is as long as 'lambda' for a
>>
>>Some built-in function names OFTEN "start a line" -- setattr, for
>>example (you're far more rarely going to use setattr EXCEPT at the
>>start of a line).
> 
> So what? - some keywords not only OFTEN but ALWAYS start a line.

So, the assertion that built-in function names never start a line
is incorrect.  The fact that some keywords "always start a line"
has no relevance wrt the fact that built-in function names also can --
rarely for functions that have no side effects (and for lambda),
often for those that do (such as setattr).  The only keywords that
can NEVER "start a line" (a logical line -- they could, of course,
be at the start of a physical line that's a continuation line!-)
are: and, in, is, or.


> Jack Diederich is obviously OK with long words starting a line, so I
> didn't have anything to be confused about in that case.
> 
>>> start. What is the relevance of the distinction between keywords and
>>> standard identifiers in this issue?
>>
>>No idea, just wanted to correct the previous strange assertion;-).
> 
> Correct what?

The strange assertion that built-in function names "never start a
line".


> For me, the strange assertion is that "'lambda' is ... one of the few
> keywords that never starts a line". It's pretty much accurate, but I

If you change "never" into "rarely", it becomes accurate, and you
can then also strengthen the "one of the few keywords" into "the
only keyword" -- four keywords are operators ('in' is also used as
part of 'for' syntax) and NEVER start (logical) lines, 24 begin
statements or clauses thereof and always (for compound statements
and clauses) or often (for simple statements) start a line, lambda
is the only one that CAN do so but is RARELY seen in that role as
such an expression-statement essentially serves no useful purpose.

> don't see the relevance - especially given that other words than

I don't see the relevance of this whole discussion to anything, either.

In particular, if somebody's trying to assert something about keywords,
whether that assertion be well-founded or not, your counter-assertions
about tokens that are NOT keywords has no possible relevance that I
can see.  So, I've given up on trying to understand why all of these
non-sequiturs are accumulating on this thread and just making sure that
what _DOES_ get said, whether relevant or not, is at least correct.

> You're assertion that some built-in function names often start a line
> seems to have no relevance to either Jacks or my statements. We are
> not debating the kinds of words that *can* start a line. It has
> nothing to do with the question at hand.

It's not a question of debating, but one of asserting, specifically
of asserting things that are false.  It is NOT true that built-in
functions never start a line: they are all ALLOWED to do so (as is
lambda) [and some of them are seen in such positions frequently,
while others are seen in such positions rarely].

Feel free to continue this weird discussion, but don't be surprised
if I correct assertions that are false, quite apart from the issue
of the relevance of anything to anything else.


Alex





More information about the Python-list mailing list