mathandy / svgpathtools

A collection of tools for manipulating and analyzing SVG Path objects and Bezier curves.
MIT License
557 stars 142 forks source link

Fix tuple assignment #86

Closed skef closed 5 years ago

skef commented 5 years ago

Fix list-style assignment to tuple on line 309 of paths2svg.py

mathandy commented 5 years ago

Hey @skef, is there an issue with the way it was? Why the need for this pull-request?

skef commented 5 years ago

dimensions is generally a reference to a tuple (see, for example, lines 246 and 248 of the modified file). Python tuples (unlike lists) are immutable -- to modify a reference to a tuple you need to supply a new tuple. If you test the code with a tuple already assigned to dimensions you'll see that it fails.

I submitted the pull request because I ran into the issue in practice. (If you're curious I used your library to make the outlne SVGs for this review: https://github.com/libertinus-fonts/libertinus/pull/251#issuecomment-451648353 )

mathandy commented 5 years ago

Thanks @skef!