Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-39429: Add a new "Python Development Mode" doc page #18132
Conversation
This comment has been minimized.
This comment has been minimized.
Here's some suggestions, mostly minor grammatical fixes. The line width on some of them may need to be adjusted. I'll go over it again later when I get the chance, to see if I missed anything. |
* Add ``default`` :ref:`warning filter <describing-warning-filters>`, as | ||
:option:`-W default <-W>` command line option. The following warnings are | ||
shown, whereas they are ignored by the default warning filters: | ||
|
||
* :exc:`DeprecationWarning`; | ||
* :exc:`ImportWarning`; | ||
* :exc:`PendingDeprecationWarning`; | ||
* :exc:`ResourceWarning`. |
This comment has been minimized.
This comment has been minimized.
aeros
Jan 23, 2020
•
Member
Hmm, the wording of this section isn't entirely clear to me. Is it explaining that the listed warnings are not filtered in development mode, so they're shown instead of hidden? Also, that to re-use the default warning filters, a new command-line option "-W default" has been added?
I had to read over this part a few times, and I'm still not 100% certain that I'm quite getting it.
If I'm correctly understanding it, I'd recommend restructuring it a bit to make that more clear (might need to adjust line width):
Normally, the following warnings are filtered by the default
:ref:`warning filters <describing-warning-filters>`:
* :exc:`DeprecationWarning`;
* :exc:`ImportWarning`;
* :exc:`PendingDeprecationWarning`;
* :exc:`ResourceWarning`.
In development mode, these warnings are no longer filtered. To re-enable the default
warning filters, use the new :option:`-W default <-W>` command line option.
(Correct me if I'm misunderstanding the section)
This comment has been minimized.
This comment has been minimized.
|
||
* Enable :ref:`asyncio debug mode <asyncio-debug-mode>`. Similar to setting | ||
:envvar:`PYTHONASYNCIODEBUG` environment variable to ``1``. | ||
* Check *encoding* and *errors* arguments on string encoding and decoding |
This comment has been minimized.
This comment has been minimized.
aeros
Jan 23, 2020
Member
* Check *encoding* and *errors* arguments on string encoding and decoding | |
* Check the *encoding* and *errors* arguments for string encoding and decoding |
This comment has been minimized.
This comment has been minimized.
Also, thanks for adding this highly informative section, @vstinner! I actually learned a decent amount about the development mode that I wasn't previously aware of while proofreading it. |
|
||
The Python Development Mode introduces additional runtime checks which are too | ||
expensive to be enabled by default. It should not be more verbose than the | ||
default if the code is correct: new warnings are only emitted when an issue is |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is amazing. Thank you! Big +1. |
* Add ``default`` :ref:`warning filter <describing-warning-filters>`, as | ||
:option:`-W default <-W>` command line option. The following warnings are | ||
shown, whereas they are ignored by the default warning filters: | ||
|
||
* :exc:`DeprecationWarning`; | ||
* :exc:`ImportWarning`; | ||
* :exc:`PendingDeprecationWarning`; | ||
* :exc:`ResourceWarning`. |
This comment has been minimized.
This comment has been minimized.
No problem. It looks significantly improved with the latest round of changes. Here's a few additional suggestions (some from new areas, others from existing ones I didn't see before): |
One last remaining change in L92-L93 of
to
(Grammar and line width fix) Other than that, LGTM! Thanks @vstinner. |
Truncate also long lines
This comment has been minimized.
This comment has been minimized.
fixed |
b9783d2
into
python:master
vstinner commentedJan 23, 2020
•
edited by bedevere-bot
https://bugs.python.org/issue39429