Opened 9 years ago
Last modified 6 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 )
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)
Change History (17)
Changed 9 years ago by
comment:1 Changed 9 years ago by
- Description modified (diff)
- Status changed from new to needs_review
comment:2 Changed 9 years ago by
- Component changed from PLEASE CHANGE to misc
Changed 9 years ago by
comment:3 Changed 9 years ago by
- Description modified (diff)
comment:4 Changed 9 years ago by
- Cc niles added
comment:5 Changed 9 years ago by
- Status changed from needs_review to needs_work
- Work issues set to rebase
comment:6 Changed 7 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:7 Changed 7 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:8 Changed 7 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:9 Changed 6 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:10 Changed 6 years ago by
- Branch set to u/rws/delete_some_of_the_depreciated_is___functions_
comment:11 Changed 6 years ago by
- 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:
4236760 | 12824: Delete some deprecated is_* functions
|
comment:12 Changed 6 years ago by
- 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 6 years ago by
- 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 6 years ago by
I think the split up should done in a different way:
- stop using
is_*
functions in doctests. - stop using
is_*
functions in the Sage library. - deprecate
is_*
functions.
comment:15 Changed 6 years ago by
- Description modified (diff)
- Summary changed from Delete some of the deprecated is_* functions. to Deprecate is_* functions.
Please rebase your patch.