Python, __init__ and self confusion

前端 未结 5 503
别跟我提以往
别跟我提以往 2021-01-20 02:48

Alright, so I was taking a look at some source when I came across this:

>>> def __parse(self, filename):
...         \"parse ID3v1.0 tags from MP3 f         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-20 03:20

    As an aside, it is possible to create static methods of a class in Python. The simplest way to do this is via decorators (e.g. @staticmethod). I suspect this kind of thing is usually not the Pythonic solution though.

提交回复
热议问题