-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Writing the profile to a file #10629
Comments
I don't disagree but you can just do |
Yeah that works - but it has to be |
Sure. |
So this is about adding: function print{T<:Unsigned}(filename::AbstractString, data::Vector{T} = fetch(), lidict::Dict = getdict(data); kwargs...)
open(filename) do io
print(io, data, lidict; kwargs...)
end
end about here, and testing to see that I didn't make a typo? |
Yes, these types of fixes are usually easier to just make than they are to file an issue about 😄. |
At least the code is clearer than the written description, but tests and docs are also required, so still work to do, |
I mainly filed it as a reminder for myself to get to it next week- but I was pretty sure it was a simple fix. Tests, docs etc. are usually why I try not to do things in a hurry... |
I dislike having lots of functions that accept either an I/O stream or a file name. In the long run it's easier to keep things orthogonal, learn how to write to a file once, and use that everywhere, rather than looking up which options every function supports. |
For accepting a file name, eventually I'd love to try to implement the proposal in #7299 (comment) … probably as a package first. If that were implemented, you would say: |
We already allow
Profile.print()
to take an IO object. It would be very convenient if it could take a string representing the filename to write to, and save the profile to a file. Otherwise, one has to do:Instead, just doing this would be much more convenient, and user-friendly:
The text was updated successfully, but these errors were encountered: