Deprecate Path.append with list argument
What does the merge request do?
Deprecate Path.append with list argument. IMO it's not very pythonic: append expects a single element, if you want to append multiple, there's extend. This functionality is also not used in our codebase, except for the turtle where I've fixed it. The way
Also it avoids repeated instance checks on path operations, which shaves off another 10% on path.reverse() and path.transform() operations. This benefit is already reaped by the current implementation of the deprecation (EAFP).
Implementation notes
IMO we should be much stricter with which types which functions accept. Always creating new objects quickly gets expensive. If I were to write a Transform class with no requirement of backwards compatibility, I'd probably disable the public constructor (using a cls override of __call__), and have methods like Transform.from_string, Transform.from_list, Transform.from_complex etc. Easier typing, faster because of no instance checks, very transparent API. There is also no need for operator overrides to create new objects all the time, if the other type doesn't fit, just return NotImplemented.
These small inefficiencies really add up. I'm not sure what we can do about them at this point.
Summary for release notes
For developers: Path.append with list argument has been deprecated, use Path.extend instead.
Checklist
-
Add unit tests (if applicable) -
Changes to inkex/are well documented -
Clean merge request history