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

Documentation for escape_string is inaccurate #22286

Closed
KristofferC opened this issue Jun 8, 2017 · 4 comments
Closed

Documentation for escape_string is inaccurate #22286

KristofferC opened this issue Jun 8, 2017 · 4 comments
Labels
docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia

Comments

@KristofferC
Copy link
Sponsor Member

escape_string([io,] str::AbstractString[, esc::AbstractString]) -> AbstractString

Note the return value. Nope:

julia> typeof(escape_string(IOBuffer(), "abc", "ab"))
Void
@KristofferC KristofferC added docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia labels Jun 8, 2017
@KristofferC
Copy link
Sponsor Member Author

KristofferC commented Jun 8, 2017

Also, this should work?

julia> escape_string("foo", "f")
ERROR: MethodError: no method matching escape_string(::String, ::String)
Closest candidates are:
  escape_string(::Any, ::AbstractString, ::AbstractString) at strings/io.jl:233
  escape_string(::AbstractString) at strings/io.jl:249

@carstenbauer
Copy link
Member

Similar inconsistencies with unescape_string.

I will try to fix those issues and make a PR as soon as possible.

@carstenbauer
Copy link
Member

Because of #16603, I will not split up the existing function into a print_escape_string (with return type Void) and a function escape_string (with return type AbstractString). Instead I will adjust the documentation to indicate that depending on wether an io is given the return type differs.

I will also fix the escape_string("foo", "f") issue by defining a corresponding variant of escape_string.

@KristofferC
Copy link
Sponsor Member Author

Fixed by #24539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia
Projects
None yet
Development

No branches or pull requests

2 participants