# Decorator = A function that extends the behavior of another function # w/o modifying the base function # Pass the base function as an argument to the decorator def add_sprinkles(func): def wrapper(*args, **kwargs): print("*You add sprinkles 🎊*") func(*args, **kwargs) return wrapper def add_fudge(func): def wrapper(*args, **kwargs): print("*You add fudge 🍫*") func(*args, **kwargs) return wrapper @add_sprinkles @add_fudge def get_ice_cream(flavor): print(f"Here is your {flavor} ice cream 🍨") get_ice_cream("vanilla")
bro you are the best programing teacher on the youtube ...... bro i beg to say please make the complete react course from beginner to advance ...... so it must be very helpful for those people who cannot afford expensive class or intuition...bro thankyou soo much once again....💓💓💐💐🤗🤗...
Bro Code you taught me from zero to hero without knowing anything about coding thank you with your videos could make more about machine learning using python for beginners
Well, bro, to be honest, English is not my first language. As a matter of fact, I understand it easily, even though I watched some videos that are recorded in my native language and couldn't understand it. Appreciate it!
Good explanation of decorators though noting that decorators can also take arguments. I was hoping for a clear explanation on setting those up. Although I get that might be challenging to cover in 7 minutes
I have a question, but before I gotta say you're amazing man!! You don't care about the complex terms and you explain it so simply, and you also talk about why every piece is there with reasonable examples. I could have gone to documentaries and spent a good hour on them but here I am with a solid understanding of the basics of the topic within 7 minutes. Question is, what do we need the func for? Is it a representative of the get_ice_cream function, or any function that we add this Decorator to?
I have one doubt ,when we call multiple decorators we are using the func() within the wrapper right.At that time, base function will calling 2 times or not
The add_sprinkles decorator is called first. Then within this decorator, it calls the add_fudge decorator. Eventually the base function, get_ice_cream is called. You can think like this, the add_sprikles extends the add_fudge, which extends the get_ice_cream function
Hey bro! How is it going? Hope you are doing well. In this comment I am going to ask you about Android development tutorial in java. Hi bro, I learned java from your tutorial. But there is a problem. When I got into android development, I got stuck. Can you please do a tutorial android with java.
# Decorator = A function that extends the behavior of another function
# w/o modifying the base function
# Pass the base function as an argument to the decorator
def add_sprinkles(func):
def wrapper(*args, **kwargs):
print("*You add sprinkles 🎊*")
func(*args, **kwargs)
return wrapper
def add_fudge(func):
def wrapper(*args, **kwargs):
print("*You add fudge 🍫*")
func(*args, **kwargs)
return wrapper
@add_sprinkles
@add_fudge
def get_ice_cream(flavor):
print(f"Here is your {flavor} ice cream 🍨")
get_ice_cream("vanilla")
Can you do power apps tutorial
you are boss
bro plz cover react advanced topics
Please also make a video of kotlin language also
This is the clearest explanation I have heard. Thank you.
I had some doubts regarding this topic today...and you just clutched at right time and solved my problem...thank you bro code!
bro you are the best programing teacher on the youtube ...... bro i beg to say please make the complete react course from beginner to advance ...... so it must be very helpful for those people who cannot afford expensive class or intuition...bro thankyou soo much once again....💓💓💐💐🤗🤗...
Bro Code you taught me from zero to hero without knowing anything about coding thank you with your videos could make more about machine learning using python for beginners
Your every single video is useful & meaning full Thanks for the video Bro😃
the best video for decorators finally i got it bro thanks
didn't saw the time going, very helpful tutorial thx
you made the concept very clear in simple way..thank you very much
I 100% thought the poop emoji was coming with fudge. Nice video!
why is it not calling func() per decorator when you have multiple decorators. Why isnt it printing "Here is your icecream" multiple times?
Nice video Bro 👍
Well, bro, to be honest, English is not my first language. As a matter of fact, I understand it easily, even though I watched some videos that are recorded in my native language and couldn't understand it. Appreciate it!
Hey bro. this is one of the topics I expected from you. Thanks man!
Great explanation!
Thanks bro very helpful😀
Good explanation of decorators though noting that decorators can also take arguments. I was hoping for a clear explanation on setting those up. Although I get that might be challenging to cover in 7 minutes
I have a question, but before I gotta say you're amazing man!! You don't care about the complex terms and you explain it so simply, and you also talk about why every piece is there with reasonable examples. I could have gone to documentaries and spent a good hour on them but here I am with a solid understanding of the basics of the topic within 7 minutes.
Question is, what do we need the func for? Is it a representative of the get_ice_cream function, or any function that we add this Decorator to?
Yeah its just an argument. So any function you add the decorator to will be passed to it. Its not specific to the get_ice_cream function
@@dankwabismark2598 thank you very much
Bro Code. You are the best.
I have one doubt ,when we call multiple decorators we are using the func() within the wrapper right.At that time, base function will calling 2 times or not
The add_sprinkles decorator is called first. Then within this decorator, it calls the add_fudge decorator. Eventually the base function, get_ice_cream is called. You can think like this, the add_sprikles extends the add_fudge, which extends the get_ice_cream function
wow ur god at explaining
What is the use of the word in parentheses(func)*?
See the python full course this are arguments and key arguments
Doubt cleared.. Thank you Sir
I am still having difficulties understanding this topic.
and more recommended videos?
thanks ! i love u
I liked my own comment
Good job Johnvids
That's what bro's do😊
Do more java videos, make games
You are the best teacher ive ever had
Thanks!
Who likes icecream🍨?
👇
bro thank you very much🙏
Dude you are an actual bro
I played it at 2x speed, such that I got python decorators in 3.5 minutes.
Could someone let me know what these are used for? Like what can you do with it that you cannot do some other way?
Modifying another function without touching it
W work
bro code is life
Why do this and not call the function. Its a genuine question. Thanks to whoever responds
Calling through decorators using @at top
Because it's decorator l think you must learn Object Oriented programming before learning decorators because this topic it's more advanced
what happened to your old voice? change of mic? ( algorithm comment)
we now don't even use Alt + ; anymore because it doesn't work. Now we use Windows Key + .(period)
Hey bro! How is it going? Hope you are doing well. In this comment I am going to ask you about Android development tutorial in java.
Hi bro, I learned java from your tutorial. But there is a problem. When I got into android development, I got stuck. Can you please do a tutorial android with java.
make a video on mongoDB plz sir