Thanks for highlighting ParamSpec, I've been looking for a way to define generic function parameters in Python forever!
@jake1155776 ай бұрын
I never would have come up with the UNITS trick! Great video sir.
@viacheslav57105 ай бұрын
It's wonderful! Thank you!
@ritikdwivedi59833 ай бұрын
Thanks man, it was clear and concise
@pythonwithjames6 ай бұрын
This is great, really loved the explanation!
@Carberra6 ай бұрын
Thanks man! I tried to be very thorough about it cos I get asked about decorators quote a bit, and see quite a lot of confusion about them elsewhere too.
@MaxShapira2real6 ай бұрын
Love it! Awesome job as always. Could you share the link to the video that shows how type-parameterized decorators were cleaned up and made less messy?
@Carberra6 ай бұрын
Thanks! Soz forgot to link it kzbin.info/www/bejne/lYK7nZWth9Kknas
@igorthelight4 ай бұрын
"Python is a very simple language!" Sure! ;-)
@yousefsaddeek6 ай бұрын
look my local network was off and i was codding python for a little open source drawing app and i am constantly thinking about how to make it simpler and i remember that there is something called decorator in python and i thought it would be nice to use them and i spend few minutes to remember the exact sentax for decorators and i got the most part but what is driving me crazy how dose this video showed up immediately when the internet is back in my feed and since the internet was off I did not even think to use Google search or any kind of app and so you imagine the situation correctly I don't usually look for any python syntax or feature like it's so damn rare ☠️☠️☠️
@Micaeljm6 ай бұрын
Great video! I was hoping you would show how to make a decorator that supports both `@timer` and `@timer("ms")` (with or without arguments) at the end, which is something that I can never remember how to do right.
@Carberra6 ай бұрын
Glad you enjoyed! And I cover that next week!
@theTrigant5 ай бұрын
Why do you not typehint variables inside your functions?
@Carberra5 ай бұрын
You mean like `x: int = 0`? Type checkers can do all they need to do without them in most instances. If you prefer to do it, by all means continue, I just prefer not.
@thomaseb976 ай бұрын
python generally has really bad syntax for functional concepts and such, it's very opinionated on being object oriented and imperative the type hint for a function is really bad, it can get very bloated with the Callable[[T, U], R] especially when nested and lambdas are not implemented well nor are the syntax intuative using TypeAlias from typing is very helpful to help with the bloating of Callable