Comment (by James Pic):
Looks good but I don't see a reason for keeping a default that swallows
newlines because PEP257 forbids having a multiline sentence on the first
line anyway:
> Multi-line docstrings consist of a summary line just like a one-line
docstring, followed by a blank line, followed by a more elaborate
description.
As such, the default formater which purpose is to unwrap the first
sentence encourages breaking PEP 257.
And users who are naturally complying with PEP257 will have to override
the formatter, it should be the other way around.
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by James Pic):
Also, the not-unwraping formater will also look fine with existing
docstrings, it will work for both use cases, while the current one only
works for one use case and breaks the other. The default formater should
work for both
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:4>
Comment (by Mariusz Felisiak):
Replying to [comment:4 James Pic]:
> Also, the not-unwraping formater will also look fine with existing
docstrings, it will work for both use cases, while the current one only
works for one use case and breaks the other. The default formater should
work for both
It seems you think that Python's (not Django's) default behavior should be
changed according to PEP 257. I'd recommend to start a discussion in
Python's bugtracker. As far as I'm aware the proposed solution will allow
users to freely change a formatter, which should be enough from the Django
point of view.
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:5>
* owner: nobody => suvhotta
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:6>
Comment (by James Pic):
No, I think that Django's default behavior should match Python's PEP 257,
and also, have a default that works in all use cases.
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:7>
Comment (by Subhankar Hotta):
So as part of this issue, do we make changes to allow a user to override
the formatter through kwargs and also keep DjangoHelpFormatter as the
default?
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:8>
Comment (by Mariusz Felisiak):
Replying to [comment:8 Subhankar Hotta]:
> So as part of this issue, do we make changes to allow a user to override
the formatter through kwargs and also keep DjangoHelpFormatter as the
default?
Yes, see [https://code.djangoproject.com/ticket/33657#comment:2 comment].
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:9>
* owner: Subhankar Hotta => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:10>
* owner: (none) => Abhinav Yadav
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:11>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/15781 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:12>
* type: Cleanup/optimization => Bug
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:13>
* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:14>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"2887b9f67cadc5295ef6a0574de2c2c8fdd66905" 2887b9f]:
{{{
#!CommitTicketReference repository=""
revision="2887b9f67cadc5295ef6a0574de2c2c8fdd66905"
Fixed #33657 -- Allowed customizing formatter class of argument parsers.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:15>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"99e5ce96c6716fe43ce1dc706a9a49b77f9e7bbc" 99e5ce96]:
{{{
#!CommitTicketReference repository=""
revision="99e5ce96c6716fe43ce1dc706a9a49b77f9e7bbc"
[4.1.x] Fixed #33657 -- Allowed customizing formatter class of argument
parsers.
Backport of 2887b9f67cadc5295ef6a0574de2c2c8fdd66905 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33657#comment:16>