top | item 39977160

(no title)

ponco | 1 year ago

I feel like far too much attention is given to `[[]] * n`. In the grand scheme of things, no serious python programmer is using multiply on a sequence outside of the string construction convenience.

It's also remarkebly easy to diagnose once you see the unexpected behaviour, so anyone asking for help is going to be instantly told not to do it and use a comprehension instead.

I'm sure there are plenty of other pitfalls in other languages, though I concede this one is especially unintuitive to a new person.

discuss

order

No comments yet.