Comment 7 for bug 2065120

Revision history for this message
Chris Papademetrious (chrispitude) wrote :

'twin' doesn't feel right to me - I wouldn't have an intuitive sense of it when listed as an available method in VS Code, and the word 'twin' doesn't suggest anything about the contents being copied or not.

What about having two new methods on Tag objects?

mytag.copy() - alias for copy.copy()
mytag.copy_self() - alias for _clone()

Providing a copy() method alias for copy.copy() yields a UI that is more consistent with other methods:

====
my_body = soup.find("body").extract()
my_body = soup.find("body").copy()
my_body = soup.find("body").copy_self()
====

Plus, seeing both methods listed alongside each other in the VS Code method list tooltip would encourage an understanding of both ("if one is self-only, the other must be deep").