+ 2

Does "Self"in Python equate to a STACK in C++?

Is there any optimised STACK in Python viz. SELF?

31st Aug 2021, 9:02 PM
Sanjay Kamath
Sanjay Kamath - avatar
1 Resposta
0
No, Self in Python doesn’t equate to Stack in cpp. In Python self is just a naming convention for the first argument of a class method which refers to the object itself that the method is called on. Your could use any name... You don’t need to provide self in cpp, although ‘this’ is more equivilant, which provides a handle to that instance of a class. A stack is a container adapter.
1st Sep 2021, 5:38 PM
DavX
DavX - avatar