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, Rhamphoryncus, barry, georg.brandl, jcea, jkrukoff, ncoghlan, terry.reedy
Date 2008-06-11.12:23:22
SpamBayes Score 0.004224654
Marked as misclassified No
Message-id <1213187004.55.0.966807690894.issue643841@psf.upfronthosting.co.za>
In-reply-to
Content
Unfortunately, the standard library doesn't tend to do this kind of
delegation (aside from weakref.proxy, which implements the equivalent
code directly in C), so there isn't a lot of standard library code that
will benefit from it directly.

However, maintaining such a class on PyPI is also fairly undesirable,
due to the extremely tight coupling between the list of methods it needs
to delegate explicitly and the tp_* slots in the PyType method
definitions - add a new tp_* slot, and it's necessary to add the same
methods to the proxy class. Different Python implementations are going
to have different needs as to which slots they have to delegate
explicitly, and which can be left to the __getattribute__ catch-all
delegation.

As far as adding a module for a single class goes, I wouldn't expect it
to remain that way forever. E.g., I'd hope to eventually see a
CallableMixin that defined __get__ the same way a function does, making
it easier to create callables that behave like functions when stored as
a class attribute.

That said, I'd be happy enough with adding the ProxyMixin to the types
module instead, but I thought we were still trying to get rid of that
module.
History
Date User Action Args
2008-06-11 12:23:25ncoghlansetspambayes_score: 0.00422465 -> 0.004224654
recipients: + ncoghlan, barry, georg.brandl, terry.reedy, jcea, Rhamphoryncus, jkrukoff, PiDelport
2008-06-11 12:23:24ncoghlansetspambayes_score: 0.00422465 -> 0.00422465
messageid: <1213187004.55.0.966807690894.issue643841@psf.upfronthosting.co.za>
2008-06-11 12:23:23ncoghlanlinkissue643841 messages
2008-06-11 12:23:22ncoghlancreate