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


Groups > comp.lang.python > #45068

Re: object.enable() anti-pattern

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <cameron@cskk.homeip.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.028
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'exists.': 0.07; 'modes': 0.09; 'cc:addr:python-list': 0.11; '"0"': 0.16; '>that': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'simpson': 0.16; 'write,': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'greg': 0.24; 'cheers,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'right.': 0.26; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'thus': 0.29; 'purchased': 0.30; 'easier': 0.31; 'file': 0.32; 'know.': 0.32; 'quite': 0.32; 'open': 0.33; 'skip:_ 10': 0.34; 'maybe': 0.34; 'but': 0.35; 'really': 0.36; 'received:com.au': 0.36; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'received:211': 0.38; 'legally': 0.39; 'enough': 0.39; 'either': 0.39; 'skip:u 10': 0.60; 'content-disposition:inline': 0.62; 'day.': 0.63; 'more': 0.64; 'listening': 0.74; 'music': 0.75; 'lack': 0.78; 'subject:skip:o 10': 0.84; 'url:politics': 0.84; 'url:cid': 0.91; 'url:comments': 0.91; 'url:sid': 0.93
Date Fri, 10 May 2013 09:29:33 +1000
From Cameron Simpson <cs@zip.com.au>
To Greg Ewing <greg.ewing@canterbury.ac.nz>
Subject Re: object.enable() anti-pattern
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <518C29AD.7070302@canterbury.ac.nz>
User-Agent Mutt/1.5.21 (2010-09-15)
References <518C29AD.7070302@canterbury.ac.nz>
X-Optus-CM-Score 0
X-Optus-CM-Analysis v=2.0 cv=BPvrNysG c=1 sm=1 a=wom5GMh1gUkA:10 a=GCTqkX7shA8A:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=ZtCCktOnAAAA:8 a=KPWSBcU8E6wA:10 a=9sSjY8p1AAAA:8 a=TrBy58xVHN2oOUk0MdYA:9 a=CjuIK1q_8ugA:10 a=ChdAjXE5lkUvdteQbhpnkQ==:117
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.1513.1368144164.3114.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1368144164 news.xs4all.nl 15891 [2001:888:2000:d::a6]:52725
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:45068

Show key headers only | View raw


On 10May2013 10:56, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
| Cameron Simpson wrote:
| >You open a file with "0" modes, so
| >that it is _immediately_ not writable. Other attempts to make the
| >lock file thus fail because of the lack of write,
| 
| I don't think that's quite right. You open it with
| O_CREAT+O_EXCL, which atomically fails if the file
| already exists. The read/write modes don't really
| come into it, as far as I know.

Interesting. That is more direct. My understanding that it was
enough to create the file with 0 modes. Maybe either will do. Must
check...

Cheers,
-- 
Cameron Simpson <cs@zip.com.au>

Piracy gets easier every day, but listening to legally purchased music gets harder by the day.
Firehed - http://politics.slashdot.org/comments.pl?sid=179175&cid=14846089

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


Thread

Re: object.enable() anti-pattern Cameron Simpson <cs@zip.com.au> - 2013-05-10 09:29 +1000

csiph-web