This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
| Author | ncoghlan |
|---|---|
| Recipients | PiDelport, georg.brandl, jkrukoff, ncoghlan, terry.reedy |
| Date | 2008年05月20日.14:15:30 |
| SpamBayes Score | 0.0068772114 |
| Marked as misclassified | No |
| Message-id | <1211292964.84.0.286373415282.issue643841@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
I've attached a sample ProxyBase class that delegates all of the special methods handled by weakref.proxy (as well as the tp_oct and tp_hex slots, which weakref.proxy ignores). While there are other special methods in CPython (e.g. __enter__ and __exit__), those don't bypass the normal lookup mechanism, so the __getattribute__ override should handle them. For lack of a better name, I called the module typetools (by analogy to functools). Note that correctly implementing a proxy class as a new-style class definitely turns out to be a fairly non-trivial exercise (and since this one is still sans-tests, I don't make any promises that even it is 100% correct at this point) |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2008年05月20日 14:16:07 | ncoghlan | set | spambayes_score: 0.00687721 -> 0.0068772114 recipients: + ncoghlan, georg.brandl, terry.reedy, jkrukoff, PiDelport |
| 2008年05月20日 14:16:04 | ncoghlan | set | spambayes_score: 0.00687721 -> 0.00687721 messageid: <1211292964.84.0.286373415282.issue643841@psf.upfronthosting.co.za> |
| 2008年05月20日 14:15:59 | ncoghlan | link | issue643841 messages |
| 2008年05月20日 14:15:52 | ncoghlan | create | |