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()" deepcopys "self.root" not "self", leading to unexpected behaviour not in line with documentation #60

Open
Quwertzuiopp opened this issue Jan 31, 2021 · 2 comments

Comments

@Quwertzuiopp
Copy link

Like the title says, copying e.g. a svgutils.transform.GroupElement returns a lxml.etree._Element, not a new GroupElement. That means that if you try to copy an Element instead of reading it from disk again, the function does not return a copy of the Element, like the documentation says.

Honestly, I don't understand how this could ever be the desired behavior. This way, if you want to include the same SVG twice on two different spots of the figure, you need to pass the result of copy to the appropriate constructor before you can move it.

So I propose that either the documentation should reflect this, or the behaviour should be changed to be in line with what you would naturally expect.

@btel
Copy link
Owner

btel commented Feb 9, 2021

hi @Quwertzuiopp, thanks for the report! I agree that the expected behaviour would be the copy of svgutils class not the lxml base. Please feel free to submit a PR!

@Saransh-cpp
Copy link

Saransh-cpp commented Sep 28, 2021

@btel can I take this up (If no one is working on this)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants