Antoine Pitrou added the comment: > The issue here is copy.deepcopy will raise an exception whenever it > encounters a generator. We would like to do better here. > Unfortunately, using itertools.tee is not a solution here because it > does not preserve the type of the object.
Indeed, itertools.tee is not a general solution for copy.deepcopy, but it's a good solution to *avoid* calling copy.deepcopy when you simply want to "fork" a generator. IMHO supporting live generators (and therefore frame objects) in copy.deepcopy would be a waste of effort. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11299> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com