Opened 7 years ago

Last modified 4 years ago

#12824 needs_work task

Deprecate is_* functions.

Reported by: JStarx Owned by: tbd
Priority: major Milestone: sage-6.4
Component: misc Keywords: is_functions
Cc: niles Merged in:
Authors: Jim Stark Reviewers:
Report Upstream: N/A Work issues: split patch, docs do not build
Branch: u/rws/delete_some_of_the_depreciated_is___functions_ (Commits) Commit: 4236760f802703629e45c1084fc29468e384bf60
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

As discussed here: http://groups.google.com/group/sage-devel/browse_thread/thread/e8c2470e270f616b/c760f4a79d28f467?lnk=gst&q=is_#, functions of the form is_SomeName(x) should be deprecated.

This patch removes 106 of them and replaces them with calls to isinstance. The patch was created by running the attached python script. It searches through the source for functions of the form

def is_SomeName(x):
    """a docstring"""
    return isinstance(x, SomeName)

where SomeName? is the class of a Sage object, deletes them, and replaces any calls with calls to isinstance. After the script ran I made sure sage built, passed all its tests, and I looked through the diff to make sure nothing silly happened.

Attachments (2)

remove_is.py (8.4 KB) - added by JStarx 7 years ago.
trac12824.patch (230.4 KB) - added by JStarx 7 years ago.

Download all attachments as: .zip

Change History (17)

Changed 7 years ago by JStarx

comment:1 Changed 7 years ago by JStarx

  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 Changed 7 years ago by JStarx

  • Component changed from PLEASE CHANGE to misc

Changed 7 years ago by JStarx

comment:3 Changed 7 years ago by JStarx

  • Description modified (diff)

comment:4 Changed 7 years ago by niles

  • Cc niles added

comment:5 Changed 7 years ago by aapitzsch

  • Status changed from needs_review to needs_work
  • Work issues set to rebase

Please rebase your patch.

comment:6 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:7 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:8 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:9 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:10 Changed 5 years ago by rws

  • Branch set to u/rws/delete_some_of_the_depreciated_is___functions_

comment:11 Changed 5 years ago by rws

  • Commit set to 4236760f802703629e45c1084fc29468e384bf60
  • Work issues changed from rebase to docs do not build

Most hunks in this monster patch are either already applied or are failing, so I'm uploading what's left. However, docs do not build with this, something is seriously wrong.


New commits:

423676012824: Delete some deprecated is_* functions

comment:12 Changed 4 years ago by rws

  • Work issues changed from docs do not build to split patch, docs do not build

This should be split up, at least in a rings/, a modular/ and a ticket for the rest.

comment:13 Changed 4 years ago by jdemeyer

  • Description modified (diff)
  • Summary changed from Delete some of the depreciated is_* functions. to Delete some of the deprecated is_* functions.

You cannot just remove functions without deprecation first.

comment:14 Changed 4 years ago by jdemeyer

I think the split up should done in a different way:

  1. stop using is_* functions in doctests.
  2. stop using is_* functions in the Sage library.
  3. deprecate is_* functions.

comment:15 Changed 4 years ago by jdemeyer

  • Description modified (diff)
  • Summary changed from Delete some of the deprecated is_* functions. to Deprecate is_* functions.
Note: See TracTickets for help on using tickets.