Message1158
Thanks for testing. Checking cpython, you can del an instance dict, but then go on assigning into it as the instance grows a fresh, empty dict. The implementation seems to accomplish this by setting the dict to null on del (explicit __set__ to null, not __delete__ as far as i can tell), and then allocating a new dict on the subsequent lookup.
For jython, the suggestion of adding __delete__ to the dict descriptor, and having it assign a fresh PyStringMap for the __dict__ seems to provide the equivalent behaviour (without the lazy dict allocation). I'm attaching a patch that adds the ability to specify a __delete__ method on PyGetSetDescr, and updates the previous patch to use that. Seems to work in a bit of testing. But now the templating needs to grow an optional extra parameter for expose_getset to be used in type.expose, as the patch includes a hand-edited PyType.java (and omits type.expose for now).
Hope i'm getting warmer ... more clues welcome!
- kz |
|
Date |
User |
Action |
Args |
2008-02-20 17:17:30 | admin | link | issue1506749 messages |
2008-02-20 17:17:30 | admin | create | |
|