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

copy(x::Symbol) isn't defined #22851

Closed
sbromberger opened this issue Jul 18, 2017 · 3 comments
Closed

copy(x::Symbol) isn't defined #22851

sbromberger opened this issue Jul 18, 2017 · 3 comments
Labels
won't change Indicates that work won't continue on an issue or pull request

Comments

@sbromberger
Copy link
Contributor

Is there a particular reason this method was omitted?

@yuyichao
Copy link
Contributor

Yes because it can't be copied. #15675

@yuyichao yuyichao added the won't change Indicates that work won't continue on an issue or pull request label Jul 18, 2017
@sbromberger
Copy link
Contributor Author

sbromberger commented Jul 18, 2017

As mentioned in the linked issue, this is inconsistent. copy(5.3) works, and it's puzzling to have to do, e.g.,

copy(g::T) where T <: AbstractMetaGraph = 
    T(
        copy(g.graph), 
        copy(g.vprops), 
        copy(g.eprops), 
        copy(g.gprops), 
        g.weightfield, 
        copy(g.defaultweight)
    )

Edited: I guess I can just use deepcopy for this.

@JeffBezanson
Copy link
Member

Generally a copy method for a (mutable) container should only copy the container structure, and not values inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
won't change Indicates that work won't continue on an issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants