A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-October/029686.html below:

[Python-Dev] Weakref design questions

[Python-Dev] Weakref design questions [Python-Dev] Weakref design questionsMartin v. Loewis martin@v.loewis.de
19 Oct 2002 05:39:09 +0200
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



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4