-
Notifications
You must be signed in to change notification settings - Fork 368
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
Decision: remove _names
and make names
not perform a copy
#1655
Comments
|
The idea is that names are stored in the index either as a @nalimilan maybe |
Yes, the point isn't to support We could indeed return a custom |
@nalimilan a general purpose package would be good (or a feature in some standard package e.g. from https://github.com/JuliaCollections). |
@nalimilan Have you had a chance to discuss this with Base devs? If no I can ask a question on Discourse. |
@nalimilan I have created a proposal of a read-only array type here https://github.com/bkamins/ReadOnlyArrays.jl. |
Any opinion on https://github.com/bkamins/ReadOnlyArrays.jl?
|
Sounds good, but I'd like a broad agreement that |
Given the response and discussion I would propose that we remove Probably we should throw a depwarn here then giving a hint to use Do we go ahead this way? |
Fine we me. The advantage with this solution is that we can change it later to return a An alternative solution would be to have |
The problem with:
is that |
@nalimilan - I am not sure what to do with this. But for 1.0 I think we can leave |
How about returning the internal vector without copying, as you suggested above? It probably won't break existing code, and that way we can do whatever we want after 1.0 (including making a copy if it turns out it creates bugs in user code). |
This goes against "safety" approach we have taken recently. Who knows where people used I would go for this if the performance gain would be really important, but in this case I think it does not really matter if we are fast with this operation or not, so it is safer to perform copying. |
OK, as you prefer. |
We could decide to rename
_names
tonames
and avoid making a copy of names held in index (see #1648 (comment)).The text was updated successfully, but these errors were encountered: