PyDev highlights __call__ with an error of "should have self as first parameter.", but that is not the general "pythonic" pattern followed with metaclasses. I know that I can #@NoSelf the line, but that creates extra clutter that I would like to avoid.
Does PyDev have any support for different rulesets with metaclasses? If the static analyzer is not able to determine what classes are actually metaclasses, I would find marking up the class definition with an #@IsMetaclass comment preferable to #@NoSelf'ing each method definition. Would this be a reasonable solution?
-Ryan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I guess it could detect that your class is already a subclass of 'type' and properly handle the __call__ in that case… please enter a feature request for that.
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am curious if there is any support for exceptions to the static analyzer for metaclasses. I have some code that looks like the following:
PyDev highlights __call__ with an error of "should have self as first parameter.", but that is not the general "pythonic" pattern followed with metaclasses. I know that I can #@NoSelf the line, but that creates extra clutter that I would like to avoid.
Does PyDev have any support for different rulesets with metaclasses? If the static analyzer is not able to determine what classes are actually metaclasses, I would find marking up the class definition with an #@IsMetaclass comment preferable to #@NoSelf'ing each method definition. Would this be a reasonable solution?
-Ryan
I guess it could detect that your class is already a subclass of 'type' and properly handle the __call__ in that case… please enter a feature request for that.
Cheers,
Fabio
Adding it now. Thanks Fabio.
-Ryan