[Python-ideas] Object grabbing

Koos Zevenhoven k7hoven at gmail.com
Mon May 2 08:20:14 EDT 2016


On Mon, May 2, 2016 at 2:48 PM, João Santos <jmcs at jsantos.eu> wrote:
> I think the ".d = 1" statement feels like a bug waiting to happen. It's very
> easy to miss a dot.
>

I suppose that's a valid concern, especially regarding assignments,
because the code typically would still run. But in the beginning of
the line, it is usually quite easy to see if there's a dot or not,
assuming a fixed-width font and proper indenting.

Anyway, it seems to me this would make sense in with statements:

with open(filename):
    #do stuff
    .write(stuff)
    #do more stuff
    .write(more_stuff)

-- Koos


More information about the Python-ideas mailing list