Re: [Python-ideas] A directive for indentation type, stricter indentation parsing.

2019-03-26 Thread Christopher Barker
> > So my point was that it would be cool to have a dedicated statement for > this Look in the archives of this list — therewasa rejected proposal for dedented strings as s language feature fairly recently. -CHB > > -- Christopher Barker, PhD Python Language Consulting - Teaching -

Re: [Python-ideas] A directive for indentation type, stricter indentation parsing.

2019-03-26 Thread Mikhail V
On Tue, Mar 26, 2019 at 2:02 PM Chris Angelico wrote: > > On Tue, Mar 26, 2019 at 9:49 PM Mikhail V wrote: > > Procedural removal is not cool, because it does not know the parent > > indentation > > [...] > > E.g. this: > > s = """ > > Hello > > world""" > >

Re: [Python-ideas] A directive for indentation type, stricter indentation parsing.

2019-03-26 Thread Chris Angelico
On Tue, Mar 26, 2019 at 9:49 PM Mikhail V wrote: > Procedural removal is not cool, because it does not know the parent > indentation > of the statement that contains the text block, thus it can't resolve > automatically > string indents that were intentionally indented to include extra space. >

Re: [Python-ideas] A directive for indentation type, stricter indentation parsing.

2019-03-26 Thread Mikhail V
On Tue, Mar 26, 2019 at 7:04 AM fhsxfhsx wrote: > > Just as to your example, you can try `textwrap.dedent` > Procedural removal is not cool, because it does not know the parent indentation of the statement that contains the text block, thus it can't resolve automatically string indents that were

Re: [Python-ideas] A directive for indentation type, stricter indentation parsing.

2019-03-25 Thread fhsxfhsx
Just as to your example, you can try `textwrap.dedent` At 2019-03-26 00:32:26, "Mikhail V" wrote: >Not a proposal yet, but some thoughts: >I think it would help in a longer perspective if a user could >include a directive in the header of the source code file that >defines indentation

Re: [Python-ideas] A directive for indentation type, stricter indentation parsing.

2019-03-25 Thread Brett Cannon
On Mon, Mar 25, 2019 at 9:33 AM Mikhail V wrote: > Not a proposal yet, but some thoughts: > I think it would help in a longer perspective if a user could > include a directive in the header of the source code file that > defines indentation character(s) for this source file. So this > source

[Python-ideas] A directive for indentation type, stricter indentation parsing.

2019-03-25 Thread Mikhail V
Not a proposal yet, but some thoughts: I think it would help in a longer perspective if a user could include a directive in the header of the source code file that defines indentation character(s) for this source file. So this source would be parsed strictly by this char (or sequence). E.g.: