Opened 9 years ago

Last modified 9 years ago

#13109 closed enhancement

Rewrite deprecation to use trac ticket numbers — at Version 4

Reported by: vbraun Owned by: mvngu
Priority: major Milestone: sage-5.2
Component: doctest coverage Keywords:
Cc: cremona, kini, was, jason, kcrisman Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by vbraun)

As discussed on https://groups.google.com/d/topic/sage-devel/I12IeaFlE7g/discussion, change the deprecation function to the new arguments

deprecation(trac_number, message) 

where both arguments are mandatory. Once this code is in Sage, one can deduce every possible thing discussed above in this thread from the trac number. The deprecation warning can produce the URL of the trac ticket.

Analogous changes are made to deprecated_function_alias and deprecated_callable_import. Finally, the @rename_keyword(deprecated="sage version string", ...) decorator is changed to

@rename_keyword(deprecation=<trac_number>, ...)

Apply

Change History (4)

comment:1 Changed 9 years ago by kcrisman

I just have to say it, please don't hurt me!

Definition:     sage.misc.misc.deprecation(message, version=None)
Docstring:
       Issue a deprecation warning.
    
       INPUT:
    
          * "message" - an explanation why things are deprecated and by
            what it
               should be replaced.
    
          * "version" - (optional) on which version and when the
            deprecation
               occurred. Please put there the version of sage at the time
               of deprecation.

That's incompatible with the current one, as far as I understand the ways optional args with defaults work. So will the syntax for the deprecation function have to be ... deprecated?

comment:2 Changed 9 years ago by vbraun

That depends on whether the barber of Seville shaves himself or not.

comment:3 Changed 9 years ago by vbraun

  • Description modified (diff)

The first patch changes the deprecation syntax. The second adds the trac numbers to all deprecations in the Sage library. The third fixes all doctests.

comment:4 Changed 9 years ago by vbraun

  • Description modified (diff)
Note: See TracTickets for help on using tickets.