2014-06-11 18:17 GMT+02:00 Antoine Pitrou <anto...@python.org>: > Le 11/06/2014 10:28, Victor Stinner a écrit : >> (...) >> Issues describing the problem, I attached a patch implementing my ideas: >> http://bugs.python.org/issue21205 >> >> Would you be ok with these (minor) incompatible changes? > > +1 from me. > > Regards > Antoine.
I asked myself if this change can cause issues with serialization. The marshal and pickle modules cannot serialize a generator. Marshal only supports a few types. For pickle, I found this explanation: http://peadrop.com/blog/2009/12/29/why-you-cannot-pickle-generators/ So I consider that my change is safe. It changes the representation of a generator, but repr() is usually only checked in unit tests, tests can be fixed. It also changes the value of the __name__ attribute if the name of the function was changed, but I don't think that anyone relies on it. If you really want the original name of the code object, you can still get gen.gi_code.co_name. Another recent change in the Python API was the __wrapped__ attribute set by functools.wraps(). It is now chain wrapper functions, and I'm not aware of anyone complaining of such change. So I'm confident in my change :) Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com