On Apr 2, 2:10 am, John Posner wrote:
> Dennis Lee Bieber presented a code snippet with two consecutive statements
> that made me think, "I'd code this differently". So just for fun ... is
> Dennis's original statement or my "_alt" statement more idiomatically
> Pythonic? Are there even more Pytho
>> > mrkrs_alt2 = filter(lambda b: b > 127 or b in list("\r\n\t"),
block)
>> >
>>
>> Never tested my 'pythonicity', but I would do:
>>
>> def test(b) : b > 127 or b in r"\r\n\t"
Oops! Clearly,
b in "\r\n\t"
is preferable to ...
b in list("\r\n\t")
You do *not* want to u
On Apr 1, 5:10 pm, John Posner wrote:
> Dennis Lee Bieber presented a code snippet with two consecutive statements
> that made me think, "I'd code this differently". So just for fun ... is
> Dennis's original statement or my "_alt" statement more idiomatically
> Pythonic? Are there even more Pytho
Dennis Lee Bieber presented a code snippet with two consecutive statements
that made me think, "I'd code this differently". So just for fun ... is
Dennis's original statement or my "_alt" statement more idiomatically
Pythonic? Are there even more Pythonic alternative codings?
mrkrs = [b for b i