Message249948
I didn't want to get further into the weeds of debating basic design points on the tracker while blocking rc3, but, for the record -- the proposal in msg249504 that one could keep the namespace of an old and new module object effectively in sync by defining __getattr__ on the new module doesn't work AFAICT. (I assume this is the basis of Mark's assertion that the change is unmotivated.) Going through __getattr__ creates an unacceptable performance hit on attribute access. You can avoid this by copying the namespace entries over (b/c __getattr__ is only called as a fallback when __dict__ lookup fails), but then you have the same problem as before of needing to keep things in sync. (And remember that module globals can change at any time -- the __globals__ pointer for any functions defined in that module will continue to point to the old namespace.)
Re: PyPy: last I heard their main complaint about __class__ assignment was that it was hard to restrict it to *only* handle the cases that CPython does. (They do have a concept of "heap types"; AFAICT it's just a flag that says "the CPython version of this type has some quirks that we need to check for and emulate".) Not sure about Jython, but I doubt they have a natural heap/non-heap type distinction either.
Thanks Guido for handling the patches! |
|
Date |
User |
Action |
Args |
2015-09-05 22:52:57 | njs | set | recipients:
+ njs, lemburg, gvanrossum, rhettinger, ncoghlan, pitrou, vstinner, larry, benjamin.peterson, Mark.Shannon, python-dev, eltoder, serhiy.storchaka, Guido.van.Rossum |
2015-09-05 22:52:57 | njs | set | messageid: <1441493577.76.0.335663316342.issue24912@psf.upfronthosting.co.za> |
2015-09-05 22:52:57 | njs | link | issue24912 messages |
2015-09-05 22:52:56 | njs | create | |
|