-
-
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
Should fieldnames return a tuple rather than an array? #25327
Comments
Reflection on |
Could you clarify what you mean here? I'm not sure if you meant something specific to |
Conversely, what are typical use cases for |
The small story about this is that the issue is coming from slack, a user posted it as a note and there where some thumbs up and no thumbs down. I would rather let some core developer discuss the consecuences (and tradeoffs) of a deprecation for 0.7 and a switch for 1.0 or for the next major api break. |
If that's true in general (not specifically for named tuples) then we shouldn't be exporting it from |
We export lots of reflection toys from Base. I suppose we could hide them under some sort of (For NamedTuples, this is also just an artifact of their current implementation, not part of their stable API) |
The reflection tools are very useful for building good tooling; it would be sad to see them go away. Would maybe marking them "unstable" suffice, if the concern is that there are rough edges that would require breaking changes in a 1.x? |
These considerations don't seem to directly address the issue at hand, do they? What do we expect people to use |
Looking at master they are mostly used for testing and documentation. julia master (cholmod.jl):
gadfly (chain method)
So @vtjnash a The toolbox for now is composed by more than just: The currently exported methods list is not structured ordered by usecase/functionality (the work could start from here right?)
If this is the case, I'd link the discussion to #20555. |
I do think it would make sense for |
Opened #25725. |
It would sound natural to me for
fieldnames
to return a tuple. The current implementation returning an array implies an allocation even in cases where it could be avoided.This could have more visible consequences now that we haveEDIT: this comment doesn't seem accurate (see below)NamedTuple
, for which it is more common to extract the field names since they cannot be known in advance.The text was updated successfully, but these errors were encountered: