New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete or warn deprecated (rev.3) #3424
base: master
Are you sure you want to change the base?
Conversation
Suggest and removal can both be useful at the same time.
Has been deprecated since 22a9613.
Has been deprecated since 058d55a.
Has been deprecated since 0c97c8e.
Has been deprecated since 373282f.
This commit deletes {IO,ARGF,StringIO,Zib::GZipReader}#{bytes,chars,lines,codepoints}, which have been deprecated since c47c095. Note that String also has those methods. They are neither depreacted nor deleted because they are not aliases of counterpart each_something.
Has been deprecated since ebff9dc.
Has been deprecated since 684bdf6. Matz says in [ruby-core:83954] that Data should be an alias of Object. Because rb_cData has not been deprecated, let us deprecate the constant to make it a C-level synonym of rb_cObject.
Has been deprecated since 2069c9e.
Has been deprecated since 44c53ee.
Has been deprecated since c73b6bd. [Feature #17116] [ruby-dev:50945]
Has been deprecated since 3ee0648.
Has been deprecated since 2188d6d.
Has been deprecated since 4d1f86a.
Proper annotation of when to remove a feature helps us a lot ("don't delete it now" sign), but can rarely be useful to end users. Let's just use the info internally.
@@ -7641,7 +7587,7 @@ deprecated_str_setter(VALUE val, ID id, VALUE *var) | |||
{ | |||
rb_str_setter(val, id, &val); | |||
if (!NIL_P(val)) { | |||
rb_warn_deprecated("`%s'", NULL, rb_id2name(id)); | |||
rb_warn_deprecated_to_remove("`%s'", "3.1", rb_id2name(id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be rb_warn_deprecated_to_remove_use_this_one_instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the bundled gems tests error because power_assert uses pry and pry relies on Object#=~, so that will have to be fixed before this can be merged.
The changes look fine to me. rb_warn_deprecated_to_remove_use_this_one_instead
is quite long, and I'm not sure in which case it should be used instead of rb_warn_deprecated_to_remove
.
@jeremyevans Yes, the test-bundled-gems issue is pry/pry#2149 (merged). Am waiting for their release. |
Awesome to see cleanups and deprecations for Ruby 3.0! |
Aren't many of these methods still not warning (without -w)?
(with 2.7.2p137 or ruby-head) |
That's due to a different change in Ruby 2.7.2 to not display any deprecation warnings by default. The warnings show up with
|
Ah, right, I forgot about this, thanks |
As now we suppress deprecation warnings by default, does non-verbose warning period really makes sense? |
@@ -3345,7 +3345,7 @@ rb_file_directory_p(void) | |||
static VALUE | |||
rb_dir_exists_p(VALUE obj, VALUE fname) | |||
{ | |||
rb_warn_deprecated("Dir.exists?", "Dir.exist?"); | |||
rb_warn_deprecated_to_remove_use_this_one_instead("Dir.exists?", "3.2", "Dir.exist?"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is only this 3.2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have asked about FileTest.exists?
in the table at this page.
As that method is to be removed at 3.2 in the code, just the table is outdated a little?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed that the table updated in rev. 2...
Revised #3412
-w
) sinceHash#index
IO#bytes
Enumerator.new
without a blockThread.exclusive
Data
Struct::Tms
Object#=~
Dir.exists?
FileTest.exists?
$,
,$/
,$\
,$;
lambda(&variable)