Skip to content

Consider making warnings PEP 565 compliant #8465

Closed

Description

@astrojuanlu

PEP 565, accepted in 3.7, redefined the semantics of several types of warnings. In particular:

For library and framework authors that want to ensure their API compatibility warnings are more reliably seen by their users, the recommendation is to use a custom warning class that derives from DeprecationWarning in Python 3.7+, and from FutureWarning in earlier versions.

Which means that AstropyDeprecationWarning is maybe not as visible as we think, and perhaps it should derive from FutureWarning in Python < 3.7.

Activity

  1. pllim commented on Feb 28, 2019

    @pllim
    Member

    Oh, looks like we were too ahead of our times?

    Or... if we keep this open long enough such that our minversion of Python is 3.7, we can just close this without action. :trollface:

  2. mhvk commented on Feb 28, 2019

    @mhvk
    Contributor

    My vote would be to let python catch up with us...

  3. bsipocz commented on Feb 28, 2019

    @bsipocz
    Member

    My vote would be to let python catch up with us...

    and it wouldn't be the first time :trollface:

  4. bsipocz commented on Feb 28, 2019

    @bsipocz
    Member

    I'm 👎 on hacking in anything for Python <3.7 now, much of our downstream ecosystem relies on enable_deprecations_as_exceptions, changing to subclass from FutureWarning rather than from DeprecationWarning may cause issues there.

  5. bsipocz commented on Sep 30, 2019

    @bsipocz
    Member

    I'm closing this now. Our machinery is now catching both type of warnings, and there is no inclination to change the behaviour of our deprecations based on the python version we're using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions