Decorators - Advanced Python Tutorial #2

  Рет қаралды 95,791

NeuralNine

NeuralNine

Күн бұрын

Пікірлер: 115
@deei5130
@deei5130 3 жыл бұрын
This channel is easily one of the best python tutorial channels there are, if not the best one
@SparePlayss
@SparePlayss 3 жыл бұрын
Hence proved.. KZbin's Recommendation is faster than KZbin's Notification
@NeuralNine
@NeuralNine 3 жыл бұрын
:D
@destiny_02
@destiny_02 3 жыл бұрын
Uploaded : 4 hours ago This comment : 5 hours ago How in the whole damn world did you made a time machine ?
@SparePlayss
@SparePlayss 3 жыл бұрын
@@destiny_02 Lmao KZbin go brrr
@ronakshah3891
@ronakshah3891 6 ай бұрын
Can we have multiple decorators declared for a single function. For example, logging the result and calculating the time.
@tomasgorda
@tomasgorda 3 жыл бұрын
great video again, thank you very much. What environment do you using ? It looks like vi with some staff around (files structure, compilator etc.) I'm using sublime text with kite for example. Thanx a lot for your answer.
@harrybestfriend5282
@harrybestfriend5282 3 жыл бұрын
its neovim i think with a custom theme,
@tomasgorda
@tomasgorda 3 жыл бұрын
@@harrybestfriend5282 ok thank you very much 👍
@harrymagooslum5770
@harrymagooslum5770 2 жыл бұрын
Yours was the only KZbin explanation of Decorators in Python that actually demonstrated the practical use. I thank you greatly for that because the lightbulb turned on brightly as a result. You did a really nice job of it and I look forward to checking out other instructional videos that you make.
@ismahenelarbi7386
@ismahenelarbi7386 Жыл бұрын
I also recommend key2learn's videos about closures :)
@lxathu
@lxathu Жыл бұрын
And the only (or at least the first) one I've seen that doesn't leave the viewer alone with the question if calling the wrapper explicitly or by the decorating syntax are the same.
@renxooo5962
@renxooo5962 3 жыл бұрын
i always get hyped up but instantly get lazy when ima bout to code
@NeuralNine
@NeuralNine 3 жыл бұрын
Push through it you will be happy afterwards :)
@01akbarikrunal24
@01akbarikrunal24 3 жыл бұрын
def decorater(fun): def wrsper(): print("wraper fun") hello() return wrsper() def hello(): print("main function") decorater(hello)() error wraper fun main function Traceback (most recent call last): File "E:\learn\youtube.py", line 11, in decorater(hello)() TypeError: 'NoneType' object is not callable
@Alexander-dj1jp
@Alexander-dj1jp 2 жыл бұрын
in your function you take "fun" as an argument, but then you try to call "hello" inside that function, you would need to call "fun" because that was your argument "hello" isn't defined inside "decorator" function, that's why you get the error.
@JTadeo128
@JTadeo128 Жыл бұрын
I'm just thinking how bad a deaf rapper would be
@antonioaugilar168
@antonioaugilar168 Жыл бұрын
Intro is annoying but the content is good.
@asaoppenheimer6944
@asaoppenheimer6944 3 жыл бұрын
Please make some video on VIM editor. How to use it with Python. How to split it like in your video. And basic commands of course.
@yooyooman3d
@yooyooman3d 3 жыл бұрын
Second
@alex_mahone
@alex_mahone 3 жыл бұрын
The timing of this lesson is perfect! I actually have to go over a script that uses pytest and a lot of decorators with one of our engineers with not a lot of coding background tomorrow. This lesson makes explaining a lot easier! Thank you!
@skrinkz8201
@skrinkz8201 3 жыл бұрын
I haven't seen a notification nor seen an update for any of your videos in my feed for the last probably 3-4 weeks O.O
@NeuralNine
@NeuralNine 3 жыл бұрын
click the bell ^^
@arihannnt
@arihannnt Ай бұрын
Just a quick query! What if we do something recursive in the function for instance I tried timing how long does it take to execute a factorial function! The recursive implementation kinda went haywire. Would love to know if there's a clean way to handle that
@WZNuget
@WZNuget 2 жыл бұрын
Note: doing decorator(function)() wont work on python 3.9 it will throw you a type error instead just do decorator(thefunction) it will call the wrapper automatically edit: if your returning the function you can use the functobecalled(function)() thing
@cytolytic
@cytolytic 3 жыл бұрын
you must do a video on your vim config
@NeuralNine
@NeuralNine 3 жыл бұрын
I will :)
@cytolytic
@cytolytic 3 жыл бұрын
@@NeuralNine thanks :D
@TestingQuantumSoftware
@TestingQuantumSoftware 2 ай бұрын
I like that you don't spend time on bs. You go direct to the point, have a clear explanations, good examples and overall great content! congrats!
@YerNar-g6t
@YerNar-g6t 8 ай бұрын
thank you very much brother!!!!! lovely videos pls dont stop, wish you all the best! cause you r the best!!!!!!!!!!!!!
@mj2068
@mj2068 Жыл бұрын
fun observation: the reason why the number of calculations increased from 10k to 90k, i.e. 9 folds. but the time they took increased by over 220 times(0.025 to 5.6) is because factorial is not linear.🤯
@TheCodingBug
@TheCodingBug 3 жыл бұрын
Great series! and it would really come in handy if someone is planning to implement custom layers for TensorFlow or Keras. I remember back in the day, I was trying to implement a custom layer for F1-score and it really took me a long time to figure out how to use these hidden functions of Python. It's great to see such a thought through video on the topic!
@pranav6957
@pranav6957 3 жыл бұрын
I always try these programming and these programs works.thanks for these best programming video to make us a best programmer. :) Love from india.😊😊
@jsmyers24151
@jsmyers24151 Жыл бұрын
The result of the code at 8:40 gave me a printout of "None" at the bottom. I used ChatGPT to tell me what was going wrong with that. It came back that I needed to remove the last "print" command at print(hello("Jeff")). I did, and "None" was no longer there. I also ditched the outer parentheses.
@arandomwho
@arandomwho 2 ай бұрын
Pretty much simple and practiacl, thanks for your awesome work!
@pankrecik
@pankrecik 3 ай бұрын
@NeuralNine to make it easier to record and watch video you could execute and preview results of the script your are working on directly from vim using shortcut
@robinferizi9073
@robinferizi9073 3 жыл бұрын
I finally understand, thank you dude
@linushoren7928
@linushoren7928 3 жыл бұрын
how did you set up your pc? with ubuntu as subsystem?
@amaanq8649
@amaanq8649 3 жыл бұрын
Windows subsystem for Linux!
@yatharthupadhyay3976
@yatharthupadhyay3976 3 жыл бұрын
Great 🔥
@dynoagency1323
@dynoagency1323 3 жыл бұрын
Hi NeuralNine i love ur videos, can u make a stock prediction bot tutorial?
@NeuralNine
@NeuralNine 3 жыл бұрын
coming soon ^^
@SimonTiger
@SimonTiger 3 жыл бұрын
16:29 Factorial spits out HUGE results for modest inputs 😄
@xzex2609
@xzex2609 Жыл бұрын
you are a gold mine , I love the way you compress information for advance topics, applications and your channel is Great.
@yuka1072
@yuka1072 3 жыл бұрын
This man is making us better and better programmers...
@ChristopherBruns-o7o
@ChristopherBruns-o7o 3 ай бұрын
so decorator us command substitution ? or like `$()` is decorator?
@ndriiblyzniuk9347
@ndriiblyzniuk9347 2 жыл бұрын
Good evening. Do you have some practice assignments?
@salarghaffarian9745
@salarghaffarian9745 10 ай бұрын
Wooww. That was awesome explanation. Thanks many times.
@aureliotomas2724
@aureliotomas2724 3 жыл бұрын
Viiiim, cool
@maximepivi
@maximepivi Жыл бұрын
your intro kicks jamaican vybz!!! gg
@latinman6830
@latinman6830 2 жыл бұрын
Could someone tell me what IDE he's using
@qodirjondadaboyev8169
@qodirjondadaboyev8169 8 ай бұрын
what is your IDE name?
@abuazzan462
@abuazzan462 3 жыл бұрын
Thank you so much for making me understand decorators and how cool and amazing they can be !
@shrishsunder1794
@shrishsunder1794 3 жыл бұрын
Yup i m wating for it 😘😘😚😚
@אנונימוס-ק5כ
@אנונימוס-ק5כ 3 жыл бұрын
Thank you Maybe @property??
@fernandomagnabosco
@fernandomagnabosco 3 жыл бұрын
I did not understood what the @ does, can u explain to me?
@nileshwagh2994
@nileshwagh2994 3 жыл бұрын
Outro music name pls🙏
@raymondhodkinson8106
@raymondhodkinson8106 3 жыл бұрын
I just don't understand running Neovim in an Ubuntu sandbox in windows.... Just make the switch, remove windows bloat.
@offisongemmanuel6932
@offisongemmanuel6932 7 ай бұрын
You're the best man!
@sudharsanbabus
@sudharsanbabus 11 ай бұрын
Thank you NeuralNine
@Brennmeister
@Brennmeister Жыл бұрын
Wow I was watching more than 10 videos until I finely understand it because it was explain with a easy example
@includeno
@includeno 3 жыл бұрын
hello how could i understand the decorators in the module Pytest? I am confused of its decorator:pytest.mark.parametrize
@oladapoajala7100
@oladapoajala7100 2 жыл бұрын
Awesome video 🙂, what neovim configurations are you using? Could you please share a link?
@jrgomez
@jrgomez Жыл бұрын
Finally I understood what's the purpose of decorators. Thanks!
@shuaibalghazali3405
@shuaibalghazali3405 Жыл бұрын
Thanks very much, This lesson was the last straw that broke the camel's back for me in understanding decorators 😃😃
@cwleungaa
@cwleungaa 2 жыл бұрын
omg , I finally understand how decorators works after such long time. Thank you very much for giving such clear explanation.
@erik-martin
@erik-martin 3 жыл бұрын
OMG so many videos and YOURS is what made it click for me! Thank you so much!
@wariare12world95
@wariare12world95 3 жыл бұрын
wow! I really didn't understand, but I appreciate you video!
@JS-ys2uk
@JS-ys2uk 2 жыл бұрын
The very best explanation of decorators I"ve seen. The examples actually make sense. Thabks
@girish6064
@girish6064 Жыл бұрын
Thanks for sharing!
@123arskas
@123arskas Жыл бұрын
Time decorator was beautiful example. Will use it everywhere.
@asifabrar5892
@asifabrar5892 3 жыл бұрын
Hey​ @NeuralNine, I love to watch your videos and try to use these lessons in my projects. I have a question about decorators. Can I use same decorator for multiple functions? like: def timed(function): ... def chd_func(): ... def chd_func_2(): ... def func(): if 1: chd_func() elif 2: chd_func_2() Here I want to use "timed" decorator for chd_func() and chd_func_2(). If I use the decorator for both child functions, the first child function always executes first. But I want to execute the func() first. What should I do?
@thirumala_reddy
@thirumala_reddy 7 ай бұрын
Good explanation
@thebry4n547
@thebry4n547 3 жыл бұрын
Can u make a tutorial to convert videos to mp3 please... :D It'd be awesome
@estelisarva3854
@estelisarva3854 Жыл бұрын
Thank you, what font are you using in your IDE, I love that font.
@jonsnow3513
@jonsnow3513 3 жыл бұрын
What is the cherry Mx keyboard you use mister , its sound is beutiful
@mah6757
@mah6757 2 ай бұрын
Love this
@fengjeremy7878
@fengjeremy7878 Жыл бұрын
Well explained!
@modikai8507
@modikai8507 Жыл бұрын
Thanks for the lesson, been trying to learn decorators for a while now.
@AshishNagar19
@AshishNagar19 Жыл бұрын
You teaches very well. Thank you sir.
@alihusham1560
@alihusham1560 2 жыл бұрын
Is there an easy way to do the block puzzle in python?
@julietatallaferro2072
@julietatallaferro2072 2 жыл бұрын
thank u !!! :D
@OldOneX
@OldOneX 2 жыл бұрын
ابداع
@AliciaMarkoe
@AliciaMarkoe 2 жыл бұрын
Thank you 🦋
@goldball-c5x
@goldball-c5x 6 ай бұрын
BRO THAT WAS THE ONLY TUTORIAL THAT HELPED ME TYSM
@StephenEhrlichPhotos
@StephenEhrlichPhotos 3 жыл бұрын
Thanks. This was packed with many helpful tips and tricks. I was hoping for a tutorial on decorators.
@metehansert647
@metehansert647 2 жыл бұрын
Good video thanks for the examples at the end.
@estebanjeldres
@estebanjeldres 3 жыл бұрын
Thanks
@andyurquhart7568
@andyurquhart7568 3 жыл бұрын
This series is so good, you be getting me a payrise :)
@phoebefibi1896
@phoebefibi1896 3 жыл бұрын
Thank you for the great video!
@abdowaheed6892
@abdowaheed6892 3 жыл бұрын
Continue, your are the best ⚡♥
@jacksmith3183
@jacksmith3183 3 жыл бұрын
Thanks appreciated.
@hastresh8709
@hastresh8709 3 жыл бұрын
What IDE is he using?
@jonastjepkema
@jonastjepkema 3 жыл бұрын
Man you are amazing!
@joaquins.a.2830
@joaquins.a.2830 3 жыл бұрын
I've learned a lot.
@chocolateimage
@chocolateimage 3 жыл бұрын
No Views 6 Likes (i know what is going on)
@NeuralNine
@NeuralNine 3 жыл бұрын
KZbin is delaying the view count ^^
@amarnadhgunakala2901
@amarnadhgunakala2901 3 жыл бұрын
Pretty nice
@BelethKing
@BelethKing 3 жыл бұрын
Hey NeuralNine ,how long will be this series? its really enjoyable.
@NeuralNine
@NeuralNine 3 жыл бұрын
Not too long I guess around 6-10 episodes :)
@BelethKing
@BelethKing 3 жыл бұрын
@@NeuralNine fine with me :) short but well explained. Keep up the good work!
@LukieHZX
@LukieHZX 3 жыл бұрын
warum nimmst du vim und nicht pycharm?
@LukieHZX
@LukieHZX 3 жыл бұрын
Und wie hast du das gemacht? Ist das YouCompleteMe, oder wie das heißt? Machst du mal ein Tutorial dazu?
@NeuralNine
@NeuralNine 3 жыл бұрын
@@LukieHZX Weil Vim für mich einfach viel besser ist. Und das Plugin heißt coc-nvim
@LukieHZX
@LukieHZX 3 жыл бұрын
@@NeuralNine Ach das ist COC. Was spricht denn gegen PyCharm und für Vim?
@NeuralNine
@NeuralNine 3 жыл бұрын
@@LukieHZX development speed, lightweight, customizability
@adaobas
@adaobas 3 жыл бұрын
I'm still learning python and I never saw anyone explaning decorators with actual useful examples, so I never really cared abou them.. thx for changing my mind
@asdf12345929
@asdf12345929 Жыл бұрын
Great explanation of decorators. Always wondered what those were. I really appreciated the practical applications that made it make a lot more sense. Thank you!
@milindoox9453
@milindoox9453 3 жыл бұрын
Hello , please How i can install the pycharm editor on Windows 7 32bit 😣
@b07x
@b07x 3 жыл бұрын
Can you please make an Ai chat bot please?
@NeuralNine
@NeuralNine 3 жыл бұрын
I have a video on that already. It is literally the recommended one on my channel's start page
@b07x
@b07x 3 жыл бұрын
@@NeuralNine no its not showing
@dynoagency1323
@dynoagency1323 3 жыл бұрын
@@b07x is showing
@destiny_02
@destiny_02 3 жыл бұрын
@@NeuralNine what is intro music name ?
@Radical9535
@Radical9535 Жыл бұрын
I needed to tye it this way not the way you had it to get output in pyx=charm anyway. mydecorator(hello_world()). not (...)().
Generators - Advanced Python Tutorial #3
9:59
NeuralNine
Рет қаралды 57 М.
5 Good Python Habits
17:35
Indently
Рет қаралды 543 М.
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
5 Useful Python Decorators (ft. Carberra)
14:34
Indently
Рет қаралды 101 М.
DuckDB in Python - The Next Pandas Killer?
19:32
NeuralNine
Рет қаралды 30 М.
Python Decorators: The Complete Guide
27:59
ArjanCodes
Рет қаралды 155 М.
Python Decorators in 15 Minutes
15:14
Kite
Рет қаралды 444 М.
Factory Design Pattern - Advanced Python Tutorial #7
11:24
NeuralNine
Рет қаралды 101 М.
PLEASE Learn These 10 Advanced Python Features
42:28
Tech With Tim
Рет қаралды 35 М.
PLEASE Use These 5 Python Decorators
20:12
Tech With Tim
Рет қаралды 113 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 199 М.
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33