Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'programmer': 0.03; 'subsequent': 0.05; 'context': 0.07; 'mentioned,': 0.07; '327': 0.09; 'character,': 0.09; 'created,': 0.09; 'python:': 0.09; 'scripts,': 0.09; 'subject:design': 0.09; 'window.': 0.09; 'subject:Help': 0.11; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'rough': 0.16; 'special.': 0.16; 'statement.': 0.16; 'subject:API': 0.16; 'syntactic': 0.16; 'tab,': 0.16; 'essential': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'all,': 0.19; 'bit': 0.19; 'fit': 0.20; 'preferred': 0.22; 'header :User-Agent:1': 0.23; 'case.': 0.24; 'script': 0.25; 'possibly': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'function': 0.29; 'michael': 0.29; 'am,': 0.29; 'gives': 0.31; 'lines': 0.31; 'file': 0.32; 'regular': 0.32; 'text': 0.33; 'entirely': 0.33; '"the': 0.34; 'subject: (': 0.35; 'editor': 0.35; 'operations': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'too': 0.37; 'manager': 0.38; 'actions': 0.38; 'window': 0.38; 'needed': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'previous': 0.38; 'itself': 0.39; 'reported': 0.39; 'structure': 0.39; 'delete': 0.39; 'to:addr:python.org': 0.39; 'easy': 0.60; 'new': 0.61; 'simple': 0.61; 'act': 0.63; 'such': 0.63; 'different': 0.65; 'close': 0.67; 'special': 0.74; 'dozens': 0.84; 'geography': 0.84; 'goto': 0.84; 'treating': 0.84; 'windowing': 0.84; 'do:': 0.91; 'treatment': 0.95 Date: Wed, 27 Mar 2013 09:56:55 -0400 From: Mitya Sirenef User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Help me pick an API design (OO vs functional) References: <68da956e-ebe0-4f58-92cd-f7ffff0075b4@googlegroups.com> <01a290d9-6a59-45ad-bc30-e09d13aa7799@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364392660 news.xs4all.nl 6861 [2001:888:2000:d::a6]:39040 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42014 On 03/27/2013 05:10 AM, Michael Herrmann wrote: >> At the very least, for small dialogs it's sipmpler to do: >> > >> > with press(CTRL + 's'): >> > write("test.txt", into="File name") >> > click("Save") > I think what the context manager approach really has going for itself > is the syntactic structure it gives to scripts, that makes it easy to > see what is going on in which window. Semantically, however, I think > the fit of this approach has some rough edges: The fact that there > needs to be some special treatment for ALT + TAB, that actions such as > `press` "sometimes" return values that are needed to continue the > script and so on. It really has its appeal, but I think it's a bit too > special and intricate to be used by a broad audience. > I think alt-tab has to be special in any case. Regular alt-tab would act like the GOTO statement. As a programmer looking at a script you have no idea where you just alt-tabbed to without possibly looking through dozens of lines of previous code. Keypresses that start a new window also seem pretty special to me. They're inherently special. After all, the essential function of a windowing system is when a new window is created, which means subsequent operations have an entirely different meaning, in a text editor key will delete a character, in a file manager key will delete a file! But, as I mentioned, if you can get away with treating simple dialogs implicitly (and I don't see why you can't, at this point), that'd be the preferred way for me. -m -- Lark's Tongue Guide to Python: http://lightbird.net/larks/ "The condition of man is already close to satiety and arrogance, and there is danger of destruction of everything in existence." - a Brahmin to Onesicritus, 327 BC, reported in Strabo's Geography