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


Groups > comp.lang.python > #104080

Re: Continuing indentation

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From srinivas devaki <mr.eightnoteight@gmail.com>
Newsgroups comp.lang.python
Subject Re: Continuing indentation
Date Sat, 5 Mar 2016 10:25:20 +0530
Lines 100
Message-ID <mailman.217.1457153768.20602.python-list@python.org> (permalink)
References <mailman.113.1456951421.20602.python-list@python.org> <8760x4bo5h.fsf@elektro.pacujo.net> <mailman.120.1456956006.20602.python-list@python.org> <871t7sbkex.fsf@elektro.pacujo.net> <nb9o0o$ndv$1@reader1.panix.com> <87vb53se36.fsf@elektro.pacujo.net> <56d8d33d$0$1585$c3e8da3$5496439d@news.astraweb.com> <56D8DF99.6070808@lucidity.plus.com> <mailman.176.1457054639.20602.python-list@python.org> <56d905a7$0$1605$c3e8da3$5496439d@news.astraweb.com> <am3oqc-17e.ln1@esprimo.zbmc.eu> <sAgCy.1286660$wX5.1145394@fx40.am4> <eab6c1a7-26ce-4b38-bad9-829edcd4f44f@googlegroups.com> <56DA1ADF.2090109@lucidity.plus.com> <mailman.207.1457138625.20602.python-list@python.org> <5d18634b-3c0f-48aa-a6b3-56fc9ce79d26@googlegroups.com> <20160304204927.4e801c71@bigbox.christie.dr>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de tAGuBNCOwiHnHsom6SGOJQkGnDXU+zd+mkFWcjy9hdcg==
Return-Path <mr.eightnoteight@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'elif': 0.04; 'string.': 0.04; 'true,': 0.04; '"""': 0.05; 'diff': 0.05; 'none,': 0.05; 'false,': 0.07; 'string;': 0.07; 'cc:addr:python-list': 0.09; 'incorrect': 0.09; 'optional': 0.09; 'reached.': 0.09; 'stderr': 0.09; 'stdout': 0.09; 'terminate.': 0.09; 'to:addr:python.list': 0.09; 'to:addr:tim.thechases.com': 0.09; 'to:name:tim chase': 0.09; 'tuple': 0.09; 'python': 0.10; 'def': 0.13; '+91': 0.15; 'argument': 0.15; "'this": 0.16; '-tkc': 0.16; '2):': 0.16; '2016': 0.16; 'bytes),': 0.16; 'child.': 0.16; 'end-of-file': 0.16; 'hacked': 0.16; 'input:': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'self.stdin:': 0.16; 'self.stdout:': 0.16; 'threads': 0.16; 'unnecessary.': 0.16; 'useless': 0.16; 'wrote:': 0.16; 'byte': 0.18; 'bytes': 0.18; 'input': 0.18; 'student': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'junior': 0.22; 'am,': 0.23; 'sat,': 0.23; 'skip:l 40': 0.23; "haven't": 0.24; 'second': 0.24; 'tim': 0.24; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'chase': 0.29; 'raise': 0.29; 'print': 0.30; 'url:mailman': 0.30; 'code': 0.30; 'source': 0.33; 'url:python': 0.33; 'similar': 0.33; 'url:listinfo': 0.34; 'file': 0.34; 'add': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'clear': 0.35; 'skip:* 20': 0.35; 'quite': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'child': 0.36; 'indian': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'thought': 0.37; 'starting': 0.37; 'doing': 0.38; 'received:209': 0.38; 'someone': 0.38; 'or,': 0.38; 'data': 0.39; 'url:mail': 0.40; 'still': 0.40; 'school': 0.62; 'email addr:gmail.com': 0.62; 'mar': 0.65; 'benefit': 0.66; 'here': 0.66; 'results.': 0.67; '(3rd': 0.84; 'ph:': 0.84; 'worried': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UW7h4f2MxLjk07vYhdt6uZ47/FGSjqwAVtvnJxVtKdg=; b=f6MwGzayxkE8mPWfi4SwvD9R+b4dWJWW7llKJSMUZpr2uzB6glfDzn6PKdE1ifye3E Zo89ZWVoJIiHiT1pe1GQgTf9wKJo2sRlp/Tsox67qlIfor7dVsqUNj4ANSnJkqQuBOT4 iN//nImCniaFQ0bkL0/KVAK3Hic7L6ri0TVTf8Vn10UiVXmjHLIlBGt0Kr/VgXd2OIKF lUWI1pl0iJpVcaU++FrM/DS0U+ltHJbdWFDOF3QhRZNiv93EbxHF5j/1fPeRYWfrqV7n teTRc0dSOnjhj+ffePMS5KPU0Pilmj0bJJKNRTAf6Nw91O9HnXOC7+pQpAJ7RYS3/cRG gxAg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UW7h4f2MxLjk07vYhdt6uZ47/FGSjqwAVtvnJxVtKdg=; b=TnLwGCPWuS9fAA/eqsXCv2axdoS1cpHjam4+/e9NnseppUnP90+CFaAXghoVQnObzp 0L8p80Qz6rRDWDcVpvgQAGoOylVucpXUj2JhxLus/TmMHEG7BbQeoyQyutlahXHAOpVw b14hp+mBdx+Y+1Gpt8txxB9XTNfjXwgsLQwEjrQy2VH0JCH9fIw/ByQEctKomjJyRmPE e+im4e/8gCjqWdNiHER/OFYDjxVwpGq8cZ/F1hGwitLQ+wM8GgaWLUOAHHSaSV6+zMeG 1kyM1E1+KAAUYpMTs3NHsOX1pIJIh3VSIYEBftZmpS472c1UCM/JqJo+Tqzyo7YSXxFN LH1Q==
X-Gm-Message-State AD7BkJKVYlqFXKD/mzpO80LWSJthkdPNMeHeUNOZdlhL5RD+g0e91UYFeKoFzCqLetKrNxAEGGujLf4Ut6qm0Q==
X-Received by 10.107.164.170 with SMTP id d42mr5274283ioj.80.1457153759955; Fri, 04 Mar 2016 20:55:59 -0800 (PST)
In-Reply-To <20160304204927.4e801c71@bigbox.christie.dr>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:104080

Show key headers only | View raw


thought i should add this here so that people will get to this after
someone decides a standard way to do this :P

look for second if condition in the source code of
subprocess.Popen(*args, **kwargs).communicate

    def communicate(self, input=None, timeout=None):
        """Interact with process: Send data to stdin.  Read data from
        stdout and stderr, until end-of-file is reached.  Wait for
        process to terminate.

        The optional "input" argument should be data to be sent to the
        child process (if self.universal_newlines is True, this should
        be a string; if it is False, "input" should be bytes), or
        None, if no data should be sent to the child.

        communicate() returns a tuple (stdout, stderr).  These will be
        bytes or, if self.universal_newlines was True, a string.
        """

        if self._communication_started and input:
            raise ValueError("Cannot send input after starting communication")

        # Optimization: If we are not worried about timeouts, we haven't
        # started communicating, and we have one or zero pipes, using select()
        # or threads is unnecessary.
        if (timeout is None and not self._communication_started and
            [self.stdin, self.stdout, self.stderr].count(None) >= 2):
            stdout = None
            stderr = None
            if self.stdin:
                self._stdin_write(input)
            elif self.stdout:
                stdout = self.stdout.read()
                self.stdout.close()
            elif self.stderr:
                stderr = self.stderr.read()
            [..... extra code snapped]

ps: Python3.5.1


On Sat, Mar 5, 2016 at 8:19 AM, Tim Chase <python.list@tim.thechases.com> wrote:
> On 2016-03-04 17:17, sohcahtoa82@gmail.com wrote:
>> x \
>> = \
>> 5
>> if \
>> y \
>> == \
>> z:
>>     print \
>>     'this is terrible'
>>     print \
>>     'but still not incorrect
>>
>> It would be terrible, still but not incorrect.
>
> And has the sociopathic benefit that the diffs make it quite clear
> what changed.  None of this
> looking-deep-into-lines-to-see-what-changed.
>
>   x \
>   = \
>   5
>   if \
>   y \
> - != \
> + == \
>   z:
>       print \
>       'this is terrible'
>       print \
>       'but still not incorrect
>
> Still terrible.  But not quite as useless as a knee-jerk reaction
> might suggest.
>
> I actually hacked together a binary-diff something like this,
> emitting every hex-formatted byte of each file on its own line, then
> diffing the two results.  I could see doing something similar to diff
> Python ASTs.
>
> -tkc
>
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 
Regards
Srinivas Devaki
Junior (3rd yr) student at Indian School of Mines,(IIT Dhanbad)
Computer Science and Engineering Department
ph: +91 9491 383 249
telegram_id: @eightnoteight

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


Thread

Continuing indentation Skip Montanaro <skip.montanaro@gmail.com> - 2016-03-02 14:43 -0600
  Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-02 22:50 +0200
    Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-02 14:01 -0800
      Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-03 00:10 +0200
        Re: Continuing indentation Skip Montanaro <skip.montanaro@gmail.com> - 2016-03-02 16:44 -0600
        Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-02 14:51 -0800
        Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-02 14:56 -0800
        Re: Continuing indentation Chris Angelico <rosuav@gmail.com> - 2016-03-03 10:46 +1100
        Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-03 13:15 +1100
        Re: Continuing indentation John Gordon <gordon@panix.com> - 2016-03-03 16:16 +0000
          Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-03 18:47 +0200
            Re: Continuing indentation Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-03-03 18:06 +0000
              Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-03 21:36 +0200
            Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-04 11:13 +1100
              Re: Continuing indentation INADA Naoki <songofacandy@gmail.com> - 2016-03-04 09:45 +0900
              Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-04 01:06 +0000
              Re: Continuing indentation INADA Naoki <songofacandy@gmail.com> - 2016-03-04 10:23 +0900
                Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-04 14:48 +1100
                Re: Continuing indentation cl@isbd.net - 2016-03-04 10:12 +0000
                Re: Continuing indentation alister <alister.ware@ntlworld.com> - 2016-03-04 14:03 +0000
                Re: Continuing indentation Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-04 08:25 -0700
                Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-04 09:36 -0800
                Re: Continuing indentation sohcahtoa82@gmail.com - 2016-03-04 13:14 -0800
                Re: Continuing indentation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-04 21:20 +0000
                Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-04 23:31 +0000
                Re: Continuing indentation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-04 23:45 +0000
                Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-04 15:53 -0800
                Re: Continuing indentation Simon Ward <simon+python@bleah.co.uk> - 2016-03-05 00:23 +0000
                Re: Continuing indentation sohcahtoa82@gmail.com - 2016-03-04 17:17 -0800
                Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-04 18:14 -0800
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 13:22 +1100
                Re: Continuing indentation Tim Chase <python.list@tim.thechases.com> - 2016-03-04 20:49 -0600
                Re: Continuing indentation srinivas devaki <mr.eightnoteight@gmail.com> - 2016-03-05 10:25 +0530
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 16:10 +1100
                Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-05 00:52 +0000
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 12:05 +1100
                Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-05 01:45 +0000
                Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-05 18:17 +1100
                Re: Continuing indentation alister <alister.ware@ntlworld.com> - 2016-03-04 13:59 +0000
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 10:41 +1100
                Re: Continuing indentation sohcahtoa82@gmail.com - 2016-03-04 16:06 -0800
                Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-05 11:30 +1100
                Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-04 17:01 -0800
              Re: Continuing indentation Erik <python@lucidity.plus.com> - 2016-03-04 02:24 +0000
              Re: Continuing indentation Marko Rauhamaa <marko@pacujo.net> - 2016-03-04 08:28 +0200
  Re: Continuing indentation codewizard@gmail.com - 2016-03-02 15:46 -0800
    Re: Continuing indentation Chris Angelico <rosuav@gmail.com> - 2016-03-03 10:54 +1100
      Re: Continuing indentation Pete Forman <petef4+usenet@gmail.com> - 2016-03-03 00:23 +0000
    Re: Continuing indentation Carl Meyer <carl@oddbird.net> - 2016-03-02 17:02 -0700
      Re: Continuing indentation Steven D'Aprano <steve@pearwood.info> - 2016-03-03 13:22 +1100
        Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-03 13:30 +1100
        Re: Continuing indentation Chris Angelico <rosuav@gmail.com> - 2016-03-03 13:33 +1100
        Re: Continuing indentation Ethan Furman <ethan@stoneleaf.us> - 2016-03-02 18:57 -0800
    Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-03 11:30 +1100
    Re: Continuing indentation cl@isbd.net - 2016-03-03 10:22 +0000

csiph-web