Awful code of the week
Steven D'Aprano
steve+python at pearwood.info
Sun Aug 7 21:26:28 EDT 2016
On Mon, 8 Aug 2016 08:03 am, Tim Delaney wrote:
> On 7 August 2016 at 16:54, Steven D'Aprano <
> steve+comp.lang.python at pearwood.info> wrote:
>
>> Seen in the office IRC channel:
>>
>>
>> (13:23:07) fred: near_limit = []
>> (13:23:07) fred: near_limit.append(1)
>> (13:23:07) fred: near_limit = len(near_limit)
>> (13:23:09) fred: WTF
>>
>
> Assuming you'e not talking about the semantics of this specific code
> (which could be reduced to near_limit = 1),
That's exactly it. They're three consecutive lines of code.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
More information about the Python-list
mailing list