Skip to content

fields in type objects should be private properties #45210

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

Open
ericphanson opened this issue May 6, 2022 · 2 comments · May be fixed by #45300
Open

fields in type objects should be private properties #45210

ericphanson opened this issue May 6, 2022 · 2 comments · May be fixed by #45300
Labels
minor change Marginal behavior change acceptable for a minor release

Comments

@ericphanson
Copy link
Contributor

julia> struct A{T}
       x::T
       end

julia> propertynames(A)
(:var, :body)

I think one should have to call propertynames(A, true) to get var and body.

Why does this matter? For me, I accidentally passed A instead of A() into something expecting a Tables.jl-compatible row, and since that generic code uses propertynames to find the "columns" of the "row", it grabbed var and body (which then Arrow tried to serialize, resulting in 200+ line unreadable stacktraces).

If this is breaking, I think we should still do it for 2.0.

@JeffBezanson JeffBezanson added triage This should be discussed on a triage call minor change Marginal behavior change acceptable for a minor release labels May 6, 2022
@JeffBezanson
Copy link
Member

Seems like a reasonable suggestion. Let's think about how breaking this might be; possibly not very.

@JeffBezanson
Copy link
Member

Triage thinks we should do this and run PkgEval. It will probably be ok.

@JeffBezanson JeffBezanson removed the triage This should be discussed on a triage call label May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor change Marginal behavior change acceptable for a minor release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants