Ticket #3654 (closed enhancement: fixed)

Opened 3 months ago

Last modified 1 month ago

[with patch, positive review] Deprecation warning function

Reported by: jason Assigned to: cwitty
Priority: major Milestone: sage-3.1.2
Component: misc Keywords:
Cc:

Description

This function introduces a "deprecation" function that sounds a warning when a user calls a function that has been deprecated. It uses the standard Python mechanism for this sort of thing.

Attachments

sage-3654-deprecation.patch (2.5 kB) - added by jason on 08/25/2008 01:35:33 PM.

Change History

07/14/2008 06:53:23 PM changed by mabshoff

IIRC warn prints to stderr, so we are not catching the output. This seems similar to Burcin's code:

def MPolynomialRing(*args, **kwds):
    import warnings
    warnings.warn("MPolynomialRing is deprecated, use PolynomialRing instead!", DeprecationWarning, stacklevel=2)
    return PolynomialRing(*args, **kwds)

The above should certainly use some more generic infrastructure like the one provided by Jason's patch.

Cheers,

Michael

08/25/2008 01:35:33 PM changed by jason

  • attachment sage-3654-deprecation.patch added.

08/25/2008 01:36:17 PM changed by jason

patch updated to fix all doctest errors and make this functionality used.

08/25/2008 02:49:35 PM changed by mabshoff

  • summary changed from [with patch, needs review] Deprecation warning function to [with patch, positive review] Deprecation warning function.
[2:44pm] mabshoff: mhansen: how do you like #3654?
[2:44pm] mabshoff: I think I will merge it 
[2:45pm] mhansen: Yep -- looks good.
[2:45pm] mabshoff: I agree. Nice work jason-
[2:45pm] jason-: yeah!

Positive review from me and the gang.

Cheers,

Michael

08/25/2008 03:07:51 PM changed by mabshoff

  • status changed from new to closed.
  • resolution set to fixed.

Merged in Sage 3.1.2.alpha1