[Patches] [ python-Patches-578688 ] incompatible, but nice strings improveme

noreply@sourceforge.net noreply@sourceforge.net
Mon, 08 Jul 2002 07:25:19 -0700


Patches item #578688, was opened at 2002-07-08 18:25
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=578688&group_id=5470

Category: Parser/Compiler
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Stepan Koltsov (yozh)
Assigned to: Nobody/Anonymous (nobody)
Summary: incompatible, but nice strings improveme

Initial Comment:
This patch changes interpretation of multiline strings
(desn't matter, single, double quoted (when NL escaped
with backslash), triple quoted).

After applying this patch, first: first charachter
after opening quote is ignored, if it is NL, example:

"""
la-la-la
"""

will be equivalent of

"""la-la-la
"""

First variant looks better, isn't is?

Second: all spaces after NL before first nonblack char
but no more then current indentation are ignored, example:

New:

def f():
    """
    This is docstring,
    mama-mama,
  apple, banana
     """

is equivalent of old:

def f():
    """This is docstring,
mama-mama,
apple, banana
"""

Patch enabled if PyPARSE_STRIPPED_STRINGS defined. I
suggest you to apply patch but undefine
PyPARSE_STRIPPED_STRINGS until python-4 ;-)

I am sure, that this semantics is right, as
alternative, I suggest adding new modifier 'i' to
strings, like 'u' and 'r', for inst. i'iddqd'.

P. S. AFAIU, editing of parsermodule.c needed.

P. P. S. I am sorry, my English suck :-(


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=578688&group_id=5470