strang thing:

Chris Angelico rosuav at
Tue Sep 13 05:42:56 CEST 2011

On Tue, Sep 13, 2011 at 1:28 PM, Steven D'Aprano
<steve+comp.lang.python at> wrote:
> The best solution is to avoid using the name "open", instead call it "open_"
> (underscore at the end is the usual convention to avoid shadowing
> built-ins). Or "open_value" or any other appropriate name.

This is why every good programmer keeps a thesaurus handy. I just now
had a "concept collision" on the word 'cancel', and did a quick search
to come up with 'annul' as an alternative. Although in this case I
didn't search my thesaurus, I actually looked for Magic: The Gathering
cards... yeah, I'm a nerd, aren't you? :)

There's lots of synonyms for open, and it's entirely possible that one
will work. Otherwise, Steven's other solution works just fine too, and
you can go humorous with that too:

sesame = open
open = "something"
file = sesame("filename", "r")


More information about the Python-list mailing list