sysinfo icon indicating copy to clipboard operation
sysinfo copied to clipboard

@classmethod annotation used when not needed

Open sunapi386 opened this issue 6 years ago • 1 comments

https://github.com/Alwayswithme/sysinfo/blob/6a44e993dd38108a5736f31a142d73e8f75f6660/sysinfo.py#L27

Using @staticmethod should be sufficient as nothing depends on cls self variable.

    @staticmethod
    def product():
        cmd = 'dmidecode -s system-product-name | head -1'
        output = sh(cmd, True)
        return Info('Product', output.strip())

sunapi386 avatar Mar 21 '18 22:03 sunapi386

thanks for your advice, it not very Pythonic

Alwayswithme avatar Jun 14 '20 13:06 Alwayswithme