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


Groups > comp.lang.python > #41833

Re: Help me pick an API design (OO vs functional)

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder1.xlned.com!news2.euro.net!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.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'syntax': 0.04; 'context': 0.07; 'explicit': 0.07; 'subject:design': 0.09; 'window.': 0.09; 'wrong,': 0.09; 'url:blog': 0.10; 'api': 0.11; 'subject:Help': 0.11; 'wrote': 0.14; '"with"': 0.16; "'a',": 0.16; 'aren\x92t': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inclined': 0.16; 'pythonistas': 0.16; 'subject:API': 0.16; 'there!': 0.16; 'world!")': 0.16; 'weird': 0.16; 'wrote:': 0.18; 'platforms': 0.22; 'questions:': 0.24; 'simpler': 0.24; 'switch': 0.26; 'header:In-Reply-To:1': 0.27; 'michael': 0.29; "we'd": 0.29; 'am,': 0.29; 'related': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'work.': 0.31; 'comments': 0.31; 'too.': 0.31; '(since': 0.31; '25,': 0.31; 'equivalent.': 0.31; 'indentation': 0.31; 'though.': 0.31; 'this.': 0.32; 'probably': 0.32; 'option': 0.32; 'linux': 0.33; 'monday,': 0.33; "i'd": 0.34; 'subject: (': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'really': 0.36; 'done': 0.36; 'entry': 0.36; 'should': 0.36; 'too': 0.37; 'manager': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'users': 0.40; 'most': 0.60; 'managers': 0.61; 'march': 0.61; 'course': 0.61; 'simple': 0.61; "you're": 0.61; 'kind': 0.63; 'our': 0.64; 'love': 0.65; 'charset:windows-1252': 0.65; 'mar': 0.68; '26,': 0.68; 'advantages': 0.68; 'obvious': 0.74; "it'd": 0.84; 'p.s.:': 0.84; 'ps.': 0.84; 'ugly,': 0.84; 'good,': 0.91; '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:content-transfer-encoding; bh=ScQGRarUO6KDe9KA5NrbCFE3AWFm5SoygiImPj+Nr/4=; b=XnuaCbVw+A6ybt+JYSga4/dd8NKitZub1pukJKytKnl0Qvy0jRtomPgZJPo02FFs0Q FJf1ot1fWyWDUyxnJuiF29uBD+Kskt8f2l/KLGaaaji4FXtWcJEOacu6WNSjp6ZLsPIV uG+ZoB3TwiSGtkbRYT7AfWkGpyIT0ysWIJaJBY1wBDkz/MXZsG1tbIA7dwDJjXilCt76 7S+s4VYwSTPFjgFKb1BhaJAUJ5COzH/5BZ0EHfNEwPJvZnceUpadWLLULCTXf4031r7x J8PZNuUK8/+tBisJeLvfy3bIrSByvkTQzvMvqOgBDoDZI4Whv1dlVO/a+n6llVMmQz0n doPA==
MIME-Version 1.0
X-Received by 10.58.75.46 with SMTP id z14mr17363509vev.52.1364245733657; Mon, 25 Mar 2013 14:08:53 -0700 (PDT)
In-Reply-To <4b2d2295-cffd-4965-8d75-ebd4f0b9da32@googlegroups.com>
References <68da956e-ebe0-4f58-92cd-f7ffff0075b4@googlegroups.com> <mailman.3699.1364240574.2939.python-list@python.org> <4b2d2295-cffd-4965-8d75-ebd4f0b9da32@googlegroups.com>
Date Tue, 26 Mar 2013 08:08:53 +1100
Subject Re: Help me pick an API design (OO vs functional)
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding quoted-printable
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.3702.1364245741.2939.python-list@python.org> (permalink)
Lines 46
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1364245741 news.xs4all.nl 6943 [2001:888:2000:d::a6]:48365
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:41833

Show key headers only | View raw


On Tue, Mar 26, 2013 at 7:48 AM, Michael Herrmann
<michael.herrmann@getautoma.com> wrote:
> On Monday, March 25, 2013 8:42:25 PM UTC+1, Kwpolska wrote:
>> ...
>>
>> >         notepad_1 = start("Notepad")
>> >         notepad_2 = start("Notepad")
>> >         with notepad_1:
>> >                 write("Hello World!")
>> >                 press(CTRL + 'a', CTRL + 'c')
>> >         with notepad_2:
>> >                 press(CTRL + 'v')
>>
>> That’s ugly, and don’t forget that your users aren’t Pythonistas most
>> of the time.
>
> I kind of like the context manager solution because the indentation makes it very obvious what happens in which window. You are right about our target group though. Also, the "with" is not as explicit as it probably should be.

What happens at the __exit__ of the context manager? What happens if
context managers are nested? I'd be inclined to the simpler option of
an explicit switch (since focus doesn't really "stack" and it'd feel
weird for focus to *sometimes* switch away when you're done working
with one window), though the context manager syntax does have its
advantages too.

>> PS. do you plan a version for non-Windows OSes?  Also, €99 is too expensive.
>
> We'd of course love to support other platforms but don't currently have the resources to do this. We actually just wrote a blog entry about this and some related questions: http://www.getautoma.com/blog/automa-faq If we have something wrong, do let us know in the comments over there!

Make the API clean enough and someone else might well write a Linux
equivalent. Then it'll be as simple as a try/import/except/import at
the top and multiple platforms will work.

> P.S.: First-time bottom-posting!

Congrats! Feels good, doesn't it :)

ChrisA

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


Thread

Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-25 12:29 -0700
  Re: Help me pick an API design (OO vs functional) Kwpolska <kwpolska@gmail.com> - 2013-03-25 20:42 +0100
    Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-25 13:48 -0700
      Re: Help me pick an API design (OO vs functional) Chris Angelico <rosuav@gmail.com> - 2013-03-26 08:08 +1100
        Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 01:53 -0700
          Re: Help me pick an API design (OO vs functional) Chris Angelico <rosuav@gmail.com> - 2013-03-26 22:38 +1100
            Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 05:13 -0700
            Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 05:13 -0700
    Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-25 13:48 -0700
  Re: Help me pick an API design (OO vs functional) Ethan Furman <ethan@stoneleaf.us> - 2013-03-25 16:11 -0700
    Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 02:06 -0700
      Re: Help me pick an API design (OO vs functional) Dave Angel <davea@davea.name> - 2013-03-26 06:26 -0400
        Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 05:04 -0700
          Re: Help me pick an API design (OO vs functional) Dave Angel <davea@davea.name> - 2013-03-26 08:42 -0400
            Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 07:33 -0700
              Re: Help me pick an API design (OO vs functional) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-26 22:37 +0000
                Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-27 02:34 -0700
                Re: Help me pick an API design (OO vs functional) Ethan Furman <ethan@stoneleaf.us> - 2013-03-27 09:45 -0700
                Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-28 03:54 -0700
                Re: Help me pick an API design (OO vs functional) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-28 00:42 +0000
                Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-28 04:41 -0700
          Re: Help me pick an API design (OO vs functional) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-26 12:59 +0000
            Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 07:26 -0700
  Re: Help me pick an API design (OO vs functional) Mitya Sirenef <msirenef@lightbird.net> - 2013-03-25 19:40 -0400
    Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 02:38 -0700
      Re: Help me pick an API design (OO vs functional) Chris Angelico <rosuav@gmail.com> - 2013-03-26 22:43 +1100
        Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 05:18 -0700
      Re: Help me pick an API design (OO vs functional) Mitya Sirenef <msirenef@lightbird.net> - 2013-03-26 09:41 -0400
        Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 07:59 -0700
          Re: Help me pick an API design (OO vs functional) Chris Angelico <rosuav@gmail.com> - 2013-03-27 02:16 +1100
            Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-27 01:45 -0700
          Re: Help me pick an API design (OO vs functional) Mitya Sirenef <msirenef@lightbird.net> - 2013-03-26 18:01 -0400
            Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-27 02:10 -0700
              Re: Help me pick an API design (OO vs functional) Mitya Sirenef <msirenef@lightbird.net> - 2013-03-27 09:56 -0400
                Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-28 03:52 -0700
    Re: Help me pick an API design (OO vs functional) Neil Cerutti <neilc@norwich.edu> - 2013-03-26 14:13 +0000
      Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-26 07:40 -0700
        Re: Help me pick an API design (OO vs functional) Dave Angel <davea@davea.name> - 2013-03-26 12:41 -0400
          Re: Help me pick an API design (OO vs functional) Neil Cerutti <neilc@norwich.edu> - 2013-03-26 17:25 +0000
          Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-27 01:55 -0700
            Re: Help me pick an API design (OO vs functional) Chris Angelico <rosuav@gmail.com> - 2013-03-27 22:44 +1100
              Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-27 05:23 -0700
              Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-03-27 05:23 -0700
  Re: Help me pick an API design (OO vs functional) Michael Herrmann <michael.herrmann@getautoma.com> - 2013-04-04 00:05 -0700

csiph-web