On Sun, Jul 19, 2020, at 12:42, Stephen J. Turnbull wrote: > > Sure - it'd have to be a new opcode at this point, > > Why? The REDUCE opcode invokes load_reduce which ... oh heck, just post it: > > > I just think the wrong decision was made in the first place, > > Which "first place", the earlier pickle that had a restricted mode, or > the "modern" pickle which based on that experience removed restricted > mode?
er, I think you've lost some context - these particular statements were regarding an aside about a hypothetical opcode that would be defined to call __newobj__, which could be defined other than by calling __new__. The function could be written to inspect its own arguments more carefully than a general constructor, and having that name could constitute advertisement by the class that the function is safe to be called by unpickle. It was the decision to call __new__ rather than __newobj__ in the NEWOBJ opcode that I was questioning. _______________________________________________ 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/3AAXFSZBDGYUAAM4HRADBHJOJPY7UXR5/ Code of Conduct: http://python.org/psf/codeofconduct/