Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc Subject: Re: Python (was Re: I did not inhale) Date: Fri, 23 Aug 2024 00:19:34 -0000 (UTC) Organization: A noiseless patient Spider Lines: 26 Message-ID: References: <20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org> <87il0lldf8.fsf@tudado.org> <20240815182717.189@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 23 Aug 2024 02:19:35 +0200 (CEST) Injection-Info: dont-email.me; posting-host="85ffc3be8faa109d14882a5f227069d6"; logging-data="665754"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/H3hmXASa6cXgD9F9bmOpr" User-Agent: Pan/0.159 (Vovchansk; ) Cancel-Lock: sha1:U13n37vHX/Mp4mD6Q3sVRJwNwCM= Bytes: 2558 On Thu, 22 Aug 2024 12:47:16 +0200, David Brown wrote: > On 22/08/2024 11:02, Lawrence D'Oliveiro wrote: >> >> Python prohibits those space/tab inconsistencies. >> > No, it does not. Python treats tabs (at the start of lines, which is > the only relevant point here) as 8 spaces by default. You can change > that with command-line flags if you want. But it is quite happy with > mixtures of tabs and spaces as long as the result after tab-to-space > conversion is consistent with Python syntax. src = \ """ def fun() : \t\tprint("line 1") \t\x20\x20\x20\x20\x20\x20\x20\x20print("line 2") fun() """ exec(src) Output: TabError: inconsistent use of tabs and spaces in indentation