Message165845
In order to implement pickling of instance methods, a means of separating
the object and the unbound method is necessary.
This is easily done for Python methods (f.__self__ and f.__func__),
but not all of builtins support __func__. Moreover, there currently
appears to be no good way to distinguish functions from bound methods.
As a first step in solving this issue, I have attached a patch which:
1) adds __func__ for all function types
2) adds a few new definitions in the types module (AllFunctionTypes etc.)
3) adds isanyfunction(), isanyboundfunction(), isanyunboundfunction() in
inspect (admittedly these are bad names)
4) functools.unbind
In case applying this patch is being considered, serious review is necessary,
as I'm not knowledgeable of cpython internals. |
|
Date |
User |
Action |
Args |
2012-07-19 17:29:07 | mstefanro | set | recipients:
+ mstefanro |
2012-07-19 17:29:06 | mstefanro | set | messageid: <1342718946.15.0.133705372041.issue15397@psf.upfronthosting.co.za> |
2012-07-19 17:29:05 | mstefanro | link | issue15397 messages |
2012-07-19 17:29:04 | mstefanro | create | |
|