Python Tutorials - Class method and Static method Decorators | Instance and Class Variable

Опубликовано: 24 Февраль 2019
на канале: Amulya's Academy
72,585
1.5k

In this Python programming video tutorial we will learn about the class method and static method decorator in detail.

Class method Decorator:

This decorator exists so you can create class methods that are passed the actual class object within the function call, much like self is passed to any other ordinary instance method in a class.

Syntax:
class class_name:
.........
@classmethod
def method_name(cls,other parameter):
.......

Static method Decorator:
To this, neither self (the object instance) nor cls (the class) is implicitly passed as the first argument. They behave like plain functions except that you can call them from an instance or the class

Syntax:
class class_name:
.........
@staticmethod
def method_name(parameter)
.......


Decorators All videos:
   • Python Decorators | Tutorial  

Property Decorator Part 1:
   • Python Tutorials - Property Decorators Part 1  

Property Decorators Part 2:
   • Python Tutorials - Property Decorators Par...  


#PythonProgramming #Decorators #@property

For more free tutorials on computer programming

  / amulsacademy  
  / amulsacademy  

Instagram Id:
Amuls Academy


На этой странице сайта вы можете посмотреть видео онлайн Python Tutorials - Class method and Static method Decorators | Instance and Class Variable длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Amulya's Academy 24 Февраль 2019, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 72,585 раз и оно понравилось 1.5 тысяч зрителям. Приятного просмотра!