Menu

#511 Static analyzer support for metaclasses

open
nobody
None
5
2011-01-14
2011-01-14
Ryan Seiff
No

The Python standard for many metaclass method signatures use cls as the first parameter instead of self. For example:

class MetaClass(type):
def __call__(cls, *args, **kwargs):
pass
def __getitem__(cls, name):
pass
def __str__(cls):
pass

PyDev highlights these method definitions with an error of "should have self as first parameter.",

This task is to implement detection of metaclasses in the static analyzer and have that act as an exception to the "self as first parameter" rules.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.