On Thu, Jun 18, 2020 at 5:36 AM Jonathan Fine <jfine2...@gmail.com> wrote:

> Python allows the user to replace fn.__code__ by a different code object.
> This is a rarely done dirty trick.
>

A dirty trick to you maybe, but occasionally useful. For example, it can be
used to implement goto: https://github.com/snoack/python-goto (I have used
this once or twice.)

With that said, your proposal is unclear to me on whether this would force
immutability on all code objects (and thereby prevent all bytecode
modification), or whether it would have an opt-out (or opt-in) mechanism.

I'm a solid -1 if this forces immutability on all code objects with no way
to opt out for those cases where you do wish to modify the bytecode.
Otherwise, I have no opinion (as I lack knowledge of the concepts your
proposal is based on).
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/YGQKA6TZ7NCISGM6A3FDWPTDMWGRAHTD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to