Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'assign': 0.07; 'dynamically': 0.07; 'filename': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'spelled': 0.09; 'variable,': 0.09; 'itself.': 0.14; 'language.': 0.14; 'invocation': 0.16; 'open()': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'record,': 0.16; 'variants': 0.16; 'write,': 0.16; 'language': 0.16; 'command': 0.22; 'url:home': 0.24; 'least': 0.26; '(for': 0.26; 'header:X-Complaints-To:1': 0.27; "doesn't": 0.30; "d'aprano": 0.31; 'pascal': 0.31; 'steven': 0.31; 'file': 0.32; 'probably': 0.32; 'languages': 0.32; 'open': 0.33; 'could': 0.34; 'agree': 0.35; 'but': 0.35; 'there': 0.35; 'surely': 0.36; 'done': 0.36; 'charset:us-ascii': 0.36; 'example,': 0.37; 'so,': 0.37; 'too': 0.37; 'operating': 0.37; 'received:76': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'anything': 0.39; 'does': 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'read': 0.60; 'associates': 0.60; 'name': 0.63; 'within': 0.65; 'surrounding': 0.68; 'physical': 0.72; 'subject:skip:o 10': 0.84; 'tended': 0.84; 'edition': 0.86; 'confirms': 0.95; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: object.enable() anti-pattern Date: Sat, 11 May 2013 15:04:41 -0400 Organization: > Bestiaria Support Staff < References: <518b88d8$0$29997$c3e8da3$5496439d@news.astraweb.com> <518c7f05$0$29997$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-253-105-168.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368299090 news.xs4all.nl 16012 [2001:888:2000:d::a6]:40169 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45146 On 10 May 2013 05:00:53 GMT, Steven D'Aprano declaimed the following in gmane.comp.python.general: > > But even if C allowed you to do so, doesn't mean that it is a good idea. > At least some variants of Pascal force you to do the following: > > # Pseudo-code. > f = open(filename) > really_open(f) > data = read(f) # or write, or *any other operation at all* > > Surely we can agree that having to call both open() and really_open() > before you get an actually opened file that you can use is one call too > many? There is *nothing* you can do with f before calling really_open(). > So why require it? > Well... As I recall, original Pascal required all files to be named on the command line invocation. There was no way to dynamically assign a file name to a file object within the language. {Looking at the 3rd Edition Jensen&Wirth confirms that -- even the ISO standard Pascal does not have an internal way to link a filename to a file variable.} > (For the record, "really_open" is spelled "reset" or "rewrite" depending > on whether you want to read or write to the file.) So your example, the open could better be names "assign" or "link", as it associates the name of the file with the file variable, but does not do anything with the file system itself -- that would be the standard Pascal reset/rewrite. A concept that is probably an artifact of the mainframe operating systems in those days. Linkage of a physical file to a languages internal "file" concept tended to be done with job control language surrounding the invocation of the program itself. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/