Martijn Pieters <m...@python.org> added the comment:

Might it be better to just *drop* the AutoProxy object altogether?

All that it adds is a delayed call to MakeProxyType(f"AutoProxy[{typeid}]", 
exposed) (with exposed defaulting to public_methods(instance)), per instance 
per process.

It could be replaced by a direct call to `MakeProxyType()`, using 
`public_methods` directly on the registered type. This wouldn't work for 
callables that are not classes or where instances add functions to the instance 
dict, but for those rare cases you can pass in the `exposed` argument.

The advantage is that it would simplify the codebase; no more need to 
special-case the BaseProxy.__reduce__ method, removing the get_methods() method 
on the Server class, etc. Less surface for this class of bugs to happen in the 
future.

----------
nosy: +mjpieters

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue30256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to