SIMPLIFY your code with decorators (+ typing)

  Рет қаралды 4,021

Carberra

Carberra

Күн бұрын

Пікірлер: 20
@ThijsFranck
@ThijsFranck 4 ай бұрын
Thanks for highlighting ParamSpec, I've been looking for a way to define generic function parameters in Python forever!
@jake115577
@jake115577 4 ай бұрын
I never would have come up with the UNITS trick! Great video sir.
@viacheslav5710
@viacheslav5710 2 ай бұрын
It's wonderful! Thank you!
@pythonwithjames
@pythonwithjames 4 ай бұрын
This is great, really loved the explanation!
@Carberra
@Carberra 4 ай бұрын
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.
@MaxShapira2real
@MaxShapira2real 3 ай бұрын
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?
@Carberra
@Carberra 3 ай бұрын
Thanks! Soz forgot to link it kzbin.info/www/bejne/lYK7nZWth9Kknas
@igorthelight
@igorthelight Ай бұрын
"Python is a very simple language!" Sure! ;-)
@yousefsaddeek
@yousefsaddeek 4 ай бұрын
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 ☠️☠️☠️
@thomaseb97
@thomaseb97 3 ай бұрын
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
@duffydan26
@duffydan26 4 ай бұрын
Can you cover meta classes in Python?
@Carberra
@Carberra 4 ай бұрын
Already have! 😄 kzbin.info/www/bejne/hKvdfIeNnsaBbJo
@sto3359
@sto3359 4 ай бұрын
Great tutorial, but the guy has some serious David Koresh vibes going on :(
@Carberra
@Carberra 4 ай бұрын
Wasn't expecting to get compared to a cult leader today I'll be honest.
@ritikdwivedi5983
@ritikdwivedi5983 Ай бұрын
Thanks man, it was clear and concise
@theTrigant
@theTrigant 2 ай бұрын
Why do you not typehint variables inside your functions?
@Carberra
@Carberra 2 ай бұрын
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.
@Micaeljm
@Micaeljm 4 ай бұрын
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.
@Carberra
@Carberra 4 ай бұрын
Glad you enjoyed! And I cover that next week!
Python has BIOMETRIC support?!
11:43
Carberra
Рет қаралды 2,3 М.
Capturing a function's LOCAL variables?!
14:58
Carberra
Рет қаралды 3,8 М.
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 69 МЛН
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 22 МЛН
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 66 МЛН
Generics: The most intimidating TypeScript feature
18:19
Matt Pocock
Рет қаралды 176 М.
5 Useful Python Decorators (ft. Carberra)
14:34
Indently
Рет қаралды 101 М.
Only Compute What You Need for Faster Programs
10:44
Senior Code Review Buddy
Рет қаралды 548
Advanced Golang: Generics Explained
13:37
Code With Ryan
Рет қаралды 64 М.
OpenAI’s New ChatGPT: 7 Incredible Capabilities!
6:27
Two Minute Papers
Рет қаралды 192 М.
Python Typing - Type Hints & Annotations
24:46
Tech With Tim
Рет қаралды 113 М.
Generics are VITAL in typed Python
16:54
Carberra
Рет қаралды 9 М.
The COMPLETE guide to Python properties
15:30
Carberra
Рет қаралды 3,4 М.
The CORRECT way to work with temporary files in Python
11:48
There's 151 itertools functions you didn't know about
12:27