This PEP does not in itself prevent anyone from replacing an object if they really want to. A determined monkeypatcher can still use sys.__dict__['modules'] = whatever
. The intention here is more to prevent accidentally setting attributes. Otherwise the consenting adults principle still applies.
1 Like