News for hackers. Stuff that matters.
Re:Object-oriented design patterns in C and kernel development by maleldil on Wednesday August 27, 2025 @01:56PM (#45042825)
Python doesn't require self to be passed. You need it in method definitions, but not calls.
Re:Object-oriented design patterns in C and kernel development by 1718627440 on Wednesday August 27, 2025 @02:27PM (#45043192)
But you can do it. Actually you can call instance methods of other classes and change the class of an instance in Python like in C, but this dynamism is probably what makes it slow. Also doing that will make the program quite complicated, more so than in C, since Python also abstracts about this.