Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #13209

Re: strang thing:

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.048
X-Spam-Evidence '*H*': 0.90; '*S*': 0.00; 'programmer': 0.10; '"r")': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:209.85.213.174': 0.16; 'received:mail- yx0-f174.google.com': 0.16; 'looked': 0.16; 'wrote:': 0.16; 'otherwise,': 0.19; 'appropriate': 0.20; "aren't": 0.21; 'header :In-Reply-To:1': 0.22; 'tue,': 0.23; 'sep': 0.23; 'pm,': 0.24; 'keeps': 0.26; 'fine': 0.26; "i'm": 0.27; 'work.': 0.27; 'convention': 0.29; 'message-id:@mail.gmail.com': 0.29; "didn't": 0.31; 'usual': 0.31; 'actually': 0.33; 'to:addr:python-list': 0.33; 'instead': 0.33; 'file': 0.36; 'using': 0.37; 'open': 0.37; 'steven': 0.38; 'too,': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; "there's": 0.39; 'why': 0.39; 'to:addr:python.org': 0.39; 'case': 0.39; "it's": 0.40; 'gathering': 0.67; 'alternative.': 0.84; 'subject:thing': 0.84; 'subject::': 0.87; 'open,': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=1CIosy/chbMhtiUT9wTLYOz3lLh5gLjZmeGYOrYekIM=; b=Dwiqud2H7e1hXs5J12RbqxdHs8uofrsqpHurF8T63wuJRYPR6kP+eOlEwS6nGj6NgG euVi3ykw0PGB7dbPsIdrEROuOwuy7nUp5yYbfNePLoAUzmypOb29U69nume+UuFyhwYJ 9ihJVHUhlFZWfq8f2SlQqxVKAH2MyU/Ijg2Ls=
MIME-Version 1.0
In-Reply-To <4e6ecde2$0$29965$c3e8da3$5496439d@news.astraweb.com>
References <mailman.793.1315297135.27778.python-list@python.org> <4e6ecde2$0$29965$c3e8da3$5496439d@news.astraweb.com>
Date Tue, 13 Sep 2011 13:42:56 +1000
Subject Re: strang thing:
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1057.1315885379.27778.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1315885379 news.xs4all.nl 2407 [2001:888:2000:d::a6]:37201
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:13209

Show key headers only | View raw


On Tue, Sep 13, 2011 at 1:28 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> 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")

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

strang thing: "守株待兔" <1248283536@qq.com> - 2011-09-06 16:18 +0800
  Re: strang thing: Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-13 13:28 +1000
    Re: strang thing: Chris Angelico <rosuav@gmail.com> - 2011-09-13 13:42 +1000

csiph-web