You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like these wrapper descriptors to be method descriptors in order to simplify optimization and generally reduce the number of special cases.
There are two obstacles to doing this.
These two types are exposed in the types module, so we cannot remove them altogether. Maybe we could make types.WrapperDescriptorType a subclass of method descriptor to simplify things, or just make types.WrapperDescriptorType an alias?
There is no way to efficiently wrap a binary C function in a method descriptor. This is easily fixed by adding a METH_OO flag for functions taking two arguments enabling effective specialization of these functions
The text was updated successfully, but these errors were encountered:
These two types are exposed in the types module, so we cannot remove them altogether. Maybe we could make types.WrapperDescriptorType a subclass of method descriptor to simplify things, or just make types.WrapperDescriptorType an alias?
There's precedent for this: types.LambdaType is an alias for types.FunctionType, and types.BuiltinMethodType and types.BuiltinFunctionType both point to builtin_function_or_method (I think they were different in Python 2?). If your proposal in this issue works out, I think aliasing the names in types.py would be a good solution.
Compare to
Wrapper descriptors and method wrappers are artifacts of the implementation. Ideally they would not exist and we would get
We would like these wrapper descriptors to be method descriptors in order to simplify optimization and generally reduce the number of special cases.
There are two obstacles to doing this.
types
module, so we cannot remove them altogether. Maybe we could maketypes.WrapperDescriptorType
a subclass of method descriptor to simplify things, or just maketypes.WrapperDescriptorType
an alias?METH_OO
flag for functions taking two arguments enabling effective specialization of these functionsThe text was updated successfully, but these errors were encountered: