Quantcast
Channel: Python static or not static - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Python static or not static

$
0
0

I recently started using PyCharm and it tells me whenever one of my methods can be static (whenever I don't use any member).

I was wondering if it is a good practice to make methods static whenever I can or not. I know it's a bad habit in other (compiled) languages but it feels that for Python it would actually be lighter. Usually these kind of corrections suggested by PyCharm are backed by a PEP number but there's none for this one.

TL;DRShould I declare my methods as static even when I don't need to use them statically?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>