Advance Python-Decorators Indepth Implementation

preview_player
Показать описание
All Playlist In My channel

Please donate if you want to support the channel through GPay UPID,

Please join as a member in my channel to get additional benefits like materials in Data Science, live streaming for Members and many more

Please do subscribe my other channel too

Connect with me here:
Рекомендации по теме
Комментарии
Автор

Thanks a lot Krish, I watched 10 different videos on this concept and struggled to understand it. However, after finding your video, the explanation finally made sense and I was able to grasp the concept clearly.

nisha
Автор

I have watch several u-tube videos on decorators & got more confused. You just made my day because I now clearly understand decorators. Excellent job!

asehacha
Автор

These videos needs to go viral, explained in such a beautifull way.

bharatkori
Автор

Finally after a month got this point cleared...Thnks Krish

mustakimsayyed
Автор

Yesterday i was searching for closure, i got various videos but not satisfied. Finally, i get this one. Thank you sir🙏🏻

govindsingh
Автор

Krish, excellent lessons! Than you for your hard work! I learned a lot here. It made me think. If I may so boldly add some additional logic to your great lecture on the copying of function's. I think Python's `concept of scope` is also an important topic to touch on when explaining function copying. Scope's are created only at function invocation( execution or call) and names are either "in scope" or "out-of-scope". I defined the welcome( ) function and using the following two assignment's: wel = welcome( ) and wel = welcome. The first assignment assigns a function call value. The later, only the function definition. NOTE: In either assignment's, the variable that is used reference's the exact same memory location of the defined function. ( I also use both the print and return statement's.) In the first assignment [ wel = welcome( ) ], I use the print statement and the <string_value> prints to standard output on the call to welcome( ). Now for function copying, and still using the print statement, I assign the variable 'wel' to 'welcome( )'. If I try to run "wel( )" I get `TypeError: 'NoneType' object is not callable `. "None" is also returned if you try to print the variable - 'wel' because there is no 'name' value given for any existing variable in the function's scope, only a print statement. If I instead use a 'return` statement instead, the returned 'value" is stored in the memory location of the welcome( ) function. The later method: `wel = welcome` (without parentheses ) copies the welcome ( ) function definition AND it's function body to "wel". Big Note here: the welcome( ) function is not executed at assignment! Now when you execute, wel( ), you get the string value. This is because the variable 'wel' is able to reference the body of the welcome( ) function in the global scope and invoke it, which 'wel( )' runs and creates it's local scope at the invocation for the value returned by the print statement. Am I close?

broswhoknowstuff
Автор

Great work Sir,
Your teaching method is very persuasive and I'm following 12 days of python for ML.
Thank you !!

prakharakumar
Автор

Hi Krish. This is an appropriate opportunity to say thanks for your great videos and thank you for the good work you are making.
I would like to comment regarding this video (time- 2:50)
wel = welcome() - is NOT a function copy, it is a function invocation
wel = welcome - creates a new reference to a function
As you are an appreciated professional, may be I didn't follow your exact meaning. Can you please clarify? Thanks

ShukyPersky
Автор

You explain so well. I understand well and I am learning out of interest. Keep going!

lalitharavichandran
Автор

wel= welcome() actually copy the string to the variable wel and not the function. you did not call wel as function is called like wel(). The correct syntax to copy a function is wel = welcome without brackets.

kingpanthom
Автор

Amazing Video! Best explanation of decorators so far! Thank You

hinata
Автор

You meant to code wel = welcome to demonstrating function copy right? Instead of wel = welcome(), which will just assign to wel whatever welcome() returns

susmitvengurlekar
Автор

Checking out the cell no helps in debugging bugs of non executions of cells (variable not found), using variables which have been initialised somewhere else, I don't need to advise this, but keep calm, don't get tense, you are doing a great work

susmitvengurlekar
Автор

Wonderful. This is what am exactly looking for decorator and clouser. Thank you Krish.

Автор

The way you explained is very good to understand easy bro excellent

g.jothilakshmikarthi
Автор

you made it easier to understand and it's great .

nurulkarim
Автор

Great Job Krish, Closure is something I never used as a terminology and decorators were always a black box until now. I liked the logical building blocks in your teaching method. I think function copy you mentioned does not copy the function as such, the variable wel simply stores the result from the earlier execution of welcome() . Correct me if I am wrong.

gopinathrajamanickam
Автор

Mind blowing explanation clear all Doubts thanku 🙏

dikshagupta
Автор

Amazing video, explanation is awesome, I was always confused about decorator. Got it now :)

rishabhkumar-qsjb
Автор

Closure mean, a function returned by another function and that returned function still have access to its sourrended variables where it is defined.

ittecheval