Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!multikabel.net!newsfeed20.multikabel.net!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.049 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'indexing': 0.07; 'subject:design': 0.09; 'subject:Help': 0.11; "'a',": 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'identifiers': 0.16; 'somewhere.': 0.16; 'subject:API': 0.16; 'world!")': 0.16; 'wrote:': 0.18; 'options': 0.25; 'header:In- Reply-To:1': 0.27; 'michael': 0.29; 'message-id:@mail.gmail.com': 0.30; 'subject: (': 0.35; 'received:209.85': 0.35; 'received:google.com': 0.35; 'next': 0.36; 'two': 0.37; 'received:209': 0.37; 'being': 0.38; 'awesome': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'referred': 0.60; 'most': 0.60; 'lost': 0.61; 'mar': 0.68; '26,': 0.68; "it'd": 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=hv+1GrwEIJKKGKLDniRXu9CfdfeKtMtnTGfcBnoGOIo=; b=BcMb0bYFfVQjpE2T3eA0sqskR4YX6SGp7w7sPRD4KB9UaY3XXYsRTajHzsB4iZHjDX vYSSKVKbGqeOdEconAK0VqW4l3ejA0Cp5ny3qsdkQx2HcSC14deA/uUHD4LOYsqOTKw9 mZ8TDgz+PK3PdS2rDEm+sRyS9KMXUNl9nGzgOYntEGO2jLnXvfxVKEU5RtJDR/yE9zRb jDGrUYJn5lJRqFZMRJLW3E50waHxWS1cHiuMyy5MSMZflTrNtUklaFzOlIiTOEw4Tauj M+BvNWofqGHS+4VBILlbOIcK1LfcBygqEOqKc9tWacdHWAkcO/4XCtzXn7F2A4xi4QFp jxaw== MIME-Version: 1.0 X-Received: by 10.220.109.145 with SMTP id j17mr18996772vcp.34.1364298198862; Tue, 26 Mar 2013 04:43:18 -0700 (PDT) In-Reply-To: <01a290d9-6a59-45ad-bc30-e09d13aa7799@googlegroups.com> References: <68da956e-ebe0-4f58-92cd-f7ffff0075b4@googlegroups.com> <01a290d9-6a59-45ad-bc30-e09d13aa7799@googlegroups.com> Date: Tue, 26 Mar 2013 22:43:18 +1100 Subject: Re: Help me pick an API design (OO vs functional) From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364298201 news.xs4all.nl 6917 [2001:888:2000:d::a6]:58542 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41882 On Tue, Mar 26, 2013 at 8:38 PM, Michael Herrmann wrote: > What do you think of designs #3 and #4? > > notepad_1 = start("Notepad") > notepad_2 = start("Notepad") > switch_to(notepad_1) > write("Hello World!") > press(CTRL + 'a', CTRL + 'c') > switch_to(notepad_2) > press(CTRL + 'v') > > notepad_1 = start("Notepad") > notepad_2 = start("Notepad") > notepad_1.activate() > write("Hello World!") > press(CTRL + 'a', CTRL + 'c') > notepad_2.activate() > press(CTRL + 'v') Ehh, I referred to these as options 2 and 4. Got lost in the indexing somewhere. These are the same two I meant, though - these are the options I think are the most plausible. (Hindsight being 20/20, it'd have been awesome if the original snippets had had identifiers next to them. Oh well, no matter.) ChrisA