Skip to content
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

Improve(?) deprecation warnings for deprecated iterators #19058

Closed
wants to merge 1 commit into from

Conversation

Sacha0
Copy link
Member

@Sacha0 Sacha0 commented Oct 21, 2016

The deprecation warnings for rest, take, drop, cycle, repeated, and countfrom (#18839) do not point to their replacements,

julia> VERSION
v"0.6.0-dev.1054"

julia> rest
WARNING: Base.rest is deprecated.
  likely near no file:0
rest (generic function with 1 method)

julia> countfrom
WARNING: Base.countfrom is deprecated.
  likely near no file:0
countfrom (generic function with 3 methods)

julia> take
WARNING: Base.take is deprecated.
  likely near no file:0
take (generic function with 2 methods)

julia> drop
WARNING: Base.drop is deprecated.
  likely near no file:0
drop (generic function with 3 methods)

julia> cycle
WARNING: Base.cycle is deprecated.
  likely near no file:0
cycle (generic function with 1 method)

julia> repeated
WARNING: Base.repeated is deprecated.
  likely near no file:0
repeated (generic function with 2 methods)

due to the relevant deprecations being @deprecate_bindings rather than @deprecates. This pull request replaces those @deprecate_bindings with an expanded set of @deprecates such that e.g.

julia> repeated(3, 4)
WARNING: repeated(x,n) is deprecated, use Iterators.repeated(x,n) instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in repeated(::Int64, ::Int64) at ./deprecated.jl:50
 in eval(::Module, ::Any) at ./boot.jl:236
 in eval(::Module, ::Any) at /Users/sacha/pkg/julia/usr/lib/julia/sys.dylib:?
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:66
 in macro expansion at ./REPL.jl:97 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:65
while loading no file, in expression starting on line 0
Base.Iterators.Take{Base.Iterators.Repeated{Int64}}(Base.Iterators.Repeated{Int64}(3),4)

If use of @deprecate_binding rather than @deprecate was intentional, please close this pull request. Best!

@Sacha0
Copy link
Member Author

Sacha0 commented Oct 22, 2016

Closing this PR as folly on my part: I originally missed the note in #18839 (comment) regarding the issues with deprecating take,drop, and friends via @deprecate. Inevitably I ran into those issues while trying to fix name clashes CI reported, and eventually found the preceding note. Best!

@Sacha0 Sacha0 closed this Oct 22, 2016
@Sacha0 Sacha0 deleted the fixiteratordeps branch October 23, 2016 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant