Тёмный

python @decorators - (intermediate) anthony explains  

anthonywritescode
Подписаться 42 тыс.
Просмотров 12 тыс.
50% 1

Опубликовано:

 

26 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 17   
@cordalisdis
@cordalisdis 2 года назад
Cool, this explanation suits perfectly to your 2021 AoC solution day 22 p2, Thank you!
@anthonywritescode
@anthonywritescode 2 года назад
these ones are also helpful: - property decorator: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-orp6bhe4i00.html - staticmethod / classmethod: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yhkpRz7TC7o.html
@waynepalumbo8917
@waynepalumbo8917 3 года назад
A "lmgtfy" command would be funny :) Seriously though, love these explains videos!
@waynepalumbo8917
@waynepalumbo8917 3 года назад
In twitch. Like you'd do '!lmgtfy decorators' and it would send the person to www.lmgtfy.com to search for 'decorators'. is lmgtfy still a thing?
@anthonywritescode
@anthonywritescode 3 года назад
oh I thought you meant in the terminal, so I made this horriterrible thing for ya: alias lmgtfy='bash -c '"'"'xdg-open google.com/search?q=$(sed '"'"'"'"'"'"'"'"'s/ /+/g'"'"'"'"'"'"'"'"'
@malakarakesh3139
@malakarakesh3139 9 месяцев назад
for the simpler version of decorator, we can simply remove the dec_inner function right? I mean it would result the same with or without
@anthonywritescode
@anthonywritescode 9 месяцев назад
sure but then it doesn't really do anything
@dominiquekostler238
@dominiquekostler238 Год назад
Did you ever end up making a video about how to use the debugger in python? I didn't find a video, maybe I overlooked it by mistake?
@anthonywritescode
@anthonywritescode Год назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-0LPuG825eAk.html the easiest way to find them is on github: github.com/anthonywritescode/explains
@dominiquekostler238
@dominiquekostler238 Год назад
@@anthonywritescode Awesome thanks :) Nice content!
@optimiserlenergie1094
@optimiserlenergie1094 4 года назад
Great! Is there a way to force a decorator on all functions? Like a autouse fixture in pytest? Thanks
@anthonywritescode
@anthonywritescode 4 года назад
"is there a way" in python is almost always yes -- but is it a good idea is a better question :) -- if it's in a class you could use a metaclass to do that, if it's in a module you could reassign all the attributes of `sys.modules[__name__]` to wrap them -- but I'd prefer explicit decoration myself, or refactor so you call something like a context manager instead
@optimiserlenergie1094
@optimiserlenergie1094 4 года назад
@@anthonywritescode thanks. The use of a context manager to do so would be an interesting video. Thanks a lot
@anthonywritescode
@anthonywritescode 4 года назад
I'm planning to talk about context managers at some point -- there's quite a bit there though
@talalkalai8748
@talalkalai8748 2 года назад
Few times I came across a situations where I needed to use decorators for methos inside a class (A decorator usinfg self) . Its always messy. Can U cover this topic?
@anthonywritescode
@anthonywritescode 2 года назад
hmmm, they're not really different than what I show here (just another argument)
@Itwasmeeeeeee
@Itwasmeeeeeee 4 года назад
wow, thanks
Далее
Купил КЛОУНА на DEEP WEB !
35:51
Просмотров 2,5 млн
skibidi toilet 77 (part 4)
05:20
Просмотров 11 млн
Python Decorators in 15 Minutes
15:14
Просмотров 448 тыс.
Understanding decorators [Python tutorial]
42:31
Просмотров 26 тыс.
Being Competent With Coding Is More Fun
11:13
Просмотров 101 тыс.