What is self in Python?

Описание к видео What is self in Python?

Python's "self" is really just a variable that points to the current instance of our class. Every method you define must accept "self" as its first argument.

Read an article version of this video at https://pym.dev/what-is-self/

Find more Python screencasts at https://pym.dev/screencasts/

00:00 A Python class with self in each method
00:28 Do we need that self argument?
01:22 What is self?
02:26 But what does self mean? Could we rename it?
03:10 Recap: self is the first method of every Python class

#python #oop

Комментарии

Информация по комментариям в разработке