[Python-ideas] Fwd: Implicit String Concatenation
thobes at gmail.com
Thu Apr 19 19:02:28 CEST 2007
On 4/16/07, Jim Jewett <jimjjewett at gmail.com> wrote:
> On 4/13/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> > Josiah Carlson wrote:
> > >>Does anyone have a use case where they *need*
> > >>the indentation to be preserved?
> > > Not personally. I think that telling people to
> > > use textwrap.dedent() is sufficient.
> > But it seems crazy to make people do this all
> > the time, when there's no reason not to do
> > it automatically in the first place.
> The textwrap methods (including a proposed dedent) might make useful
> string methods. Short of that
> (1) Where does this preservation actually hurt?
> def f(self, arg1):
> """My DocString ...
> And I continue here -- which really is what I want.
> I use docstrings online -- and I typically do want them indented like the
> (2) Should literals (or at least strings, or at least docstrings) be
> decoratable? Anywhere but a docstring, you could just call the
> function, but ... I suppose it serves the same meta-value is the
> proposed i(nternational) or t(emplate) strings.
> def f(...):
> """ ...
If docstrings is the problem you can always use a function decorator for it:
func.__doc__ = dedent(func.__doc__)
Long and indented docstring.
> Python-ideas mailing list
> Python-ideas at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas