[Python-Dev] Weakref design questions (original) (raw)
Martin v. Loewis martin@v.loewis.de
19 Oct 2002 05:39:09 +0200
- Previous message: [Python-Dev] Weakref design questions
- Next message: [Python-Dev] Weakref design questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Brian Quinlan <brian@sweetapp.com> writes:
That is definitely one possible way to do it. However, I am wrapping a complete DOM, with dozens of objects containing, collectively, hundreds of methods.
Adding an explicit check to each method seemed like a lot more pain than using proxies.
You don't have to add it to every method. You can perform the check in tp_getattro before performing the method lookup. Alternatively, you can change the ob_type of the object to simply drop the methods that are not available anymore.
Regards, Martin
- Previous message: [Python-Dev] Weakref design questions
- Next message: [Python-Dev] Weakref design questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]