Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39674: Suggest to test with DeprecationWarning #18552

Merged
merged 4 commits into from Mar 3, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Feb 18, 2020

Add a section in What's New In Python 3.9 to strongly advice to check
for DeprecationWarning in your Python projects.

https://bugs.python.org/issue39674

Add a section in What's New In Python 3.9 to strongly advice to check
for DeprecationWarning in your Python projects.
@vstinner
Copy link
Member Author

vstinner commented Feb 18, 2020

@brettcannon: Does it sound like what you proposed in the python-dev thread?

Copy link
Member

@hugovk hugovk left a comment

Some minor spelling/language suggestions.

====================================================

When Python 2.7 was still supported, many functions were kept for backward
compatibility with Python 2.7. With the end of the Python 2.7 support, these
Copy link
Member

@hugovk hugovk Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
compatibility with Python 2.7. With the end of the Python 2.7 support, these
compatibility with Python 2.7. With the end of Python 2.7 support, these


When Python 2.7 was still supported, many functions were kept for backward
compatibility with Python 2.7. With the end of the Python 2.7 support, these
backward compatibility layers have been reomved or will be removed shortly.
Copy link
Member

@hugovk hugovk Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
backward compatibility layers have been reomved or will be removed shortly.
backward compatibility layers have been removed, or will be removed soon.

When Python 2.7 was still supported, many functions were kept for backward
compatibility with Python 2.7. With the end of the Python 2.7 support, these
backward compatibility layers have been reomved or will be removed shortly.
Most of them emitted :exc:`DeprecationWarning` warning for several years. For
Copy link
Member

@hugovk hugovk Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Most of them emitted :exc:`DeprecationWarning` warning for several years. For
Most of them emitted a :exc:`DeprecationWarning` warning for several years. For

backward compatibility layers have been reomved or will be removed shortly.
Most of them emitted :exc:`DeprecationWarning` warning for several years. For
example, using ``collections.Mapping`` instead of ``collections.abc.Mapping``
emits a :exc:`DeprecationWarning` since Python 3.3 released in 2012.
Copy link
Member

@hugovk hugovk Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
emits a :exc:`DeprecationWarning` since Python 3.3 released in 2012.
emits a :exc:`DeprecationWarning` since Python 3.3, released in 2012.

example, using ``collections.Mapping`` instead of ``collections.abc.Mapping``
emits a :exc:`DeprecationWarning` since Python 3.3 released in 2012.

Test your application with :option:`-W` ``default`` command line option to see
Copy link
Member

@hugovk hugovk Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Test your application with :option:`-W` ``default`` command line option to see
Test your application with the :option:`-W` ``default`` command-line option to see

Test your application with :option:`-W` ``default`` command line option to see
:exc:`DeprecationWarning` and :exc:`PendingDeprecationWarning`, or even with
:option:`-W` ``error`` to treat them as errors. :ref:`Warnings Filter
<warning-filter>` can be used to ignore warnings from third party code.
Copy link
Member

@hugovk hugovk Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<warning-filter>` can be used to ignore warnings from third party code.
<warning-filter>` can be used to ignore warnings from third-party code.

@brettcannon
Copy link
Member

brettcannon commented Feb 28, 2020

Yep, this is what I was thinking, but you forgot to mention -X dev 😉 .

@vstinner
Copy link
Member Author

vstinner commented Mar 3, 2020

Yep, this is what I was thinking, but you forgot to mention -X dev wink .

Right. But you wrote that you wasn't convinced that the relationship between DeprecationWarning and -X dev, so I focused on warnings instead ;-)

@brettcannon
Copy link
Member

brettcannon commented Mar 3, 2020

I think it's also worth mentioning -X dev; I probably meant to not only mention it as the only way to surface deprecation warnings.

@vstinner
Copy link
Member Author

vstinner commented Mar 3, 2020

I think it's also worth mentioning -X dev; I probably meant to not only mention it as the only way to surface deprecation warnings.

Ok, done.

Doc/whatsnew/3.9.rst Outdated Show resolved Hide resolved
Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
@vstinner vstinner merged commit 116fd4a into python:master Mar 3, 2020
@vstinner vstinner deleted the warn branch Mar 3, 2020
@vstinner
Copy link
Member Author

vstinner commented Mar 3, 2020

Thanks @hugovk for your useful reviews!

@hugovk
Copy link
Member

hugovk commented Mar 3, 2020

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants