What is method chainining in Python and how to do it

Subscribers:
612
Published on ● Video Link: https://www.youtube.com/watch?v=DKyYeWd6gnQ



Category:
Guide
Duration: 15:44
5 views
0


Hello Pythoners,

In this video we will learn what is method chainning in Python and how to do it.

Some time you will found a statement like this: john.sayName().sayHello() and confuse what is type of statement is this?

Well, it is named a chainned method; methods of an object that call one after the other.

The main ingerdients is: return self statement in each of the method that you want to able to chainned call, in this case sayName() method and sayHello() method, both will have return self statement in the method definition.

There are times when you forget to write a return self statement in one of your method definition that you want to chainned and when you involve that method on your chainned method, it is still working. It is still working only when that forgotten method is put last or invoked last in the chainned method. So, the best way, is to put return self statement in all of you method definition.




Other Videos By Computertechlighthouse


2023-09-08HTML POST 2nd request packet footage captured on Pythons' IDLE.
2023-08-17Python - How To Make A Free Video Player That Shows Milisecond Using OpenCV2 And FFPYPLAYER Module
2023-08-11"April 02, 2023: Jakarta's Sky Ablaze in Fiery Sunset"
2023-08-11A miracle happen: A house side by side in Jakarta didn't get burned in big fire
2023-08-10Simple DNS Query Packet Creation And DNS Packet Response Analysis Using Python Socket Part 3
2023-08-10Simple DNS Query Packet Creation And DNS Packet Response Analysis Using Python Socket Part 2
2023-08-10Simple DNS Query Packet Creation And DNS Packet Response Analysis Using Python Socket Part 1
2023-08-08Troubleshoot No connection could be made because the target machine actively refused it
2023-08-02How to run Python scripts as scheduled task on Windows
2023-08-02How to make text on a video slides diagonally using FFMPEG drawtext filter
2023-04-29What is method chainining in Python and how to do it
2023-04-28Effect of ‘b’ character in front of a string literal in Python
2023-04-24Three ways Python can handle Windows file path
2023-04-10Who is Gog and Magog?
2023-03-02asd
2023-01-30Trying ChatGPT second times and find some important uses
2022-12-14Visual question #1
2022-10-04Cara menggunakan google slide
2022-06-28I code Nokia Snake similliar program using Small Basic
2022-05-17Penemuan Indonesia adalah radius taman eden dan tanah havillah
2022-05-17Penemuan Indonesia, Papua dan Filipina adalah bagian dari lingkaran taman Eden zaman purbakala



Tags:
chainned method in Python
chainned method
return self
return self statement
class chainned method in Python
class chainned method
method chainning
calling many methods at once
calling many methods at once in Python
invoking multiple methods call in object programming