Context managers are UNDERRATED

  Рет қаралды 1,180

Carberra

Carberra

Күн бұрын

Пікірлер: 10
@akumasenpai7673
@akumasenpai7673 2 жыл бұрын
Bro , watching your videos have made be so much better in python i don't have any words for it , even my classmate s are calling me python god as my nickname cuz i just know so much more than them ,it's all because I learnt and explored so much from your videos , please don't ever stop making videos .😭
@Carberra
@Carberra 2 жыл бұрын
All rise for our new god, Akuma!
@akumasenpai7673
@akumasenpai7673 2 жыл бұрын
@@Carberra 😭😭😭thank you.
@0xtz_
@0xtz_ 2 жыл бұрын
I was waiting for this 👌 Thanks man
@icrazyrockstar7408
@icrazyrockstar7408 2 жыл бұрын
shortcuts, hmm..... will be waiting for it too
@fewunderstandthis7355
@fewunderstandthis7355 Жыл бұрын
Cool. I recently ran into an issue where I was unable to use the boto3 S3 Client object with context manager. Would this be a good use case to create a custom ‘enhanced’ version of the class in my project?
@Carberra
@Carberra Жыл бұрын
Can't see why not. You just need to know what the teardown procedure is and you should be good to go. Make sure performance won't take a hit when creating clients and such though.
@fewunderstandthis7355
@fewunderstandthis7355 Жыл бұрын
@@Carberra Thanks - any particular reason it would take a performance hit? Before this video I didn't realize you had to build a class to allow using it with context manager. In my case I am just writing a bunch of files to S3 (it's my first time using boto3). I instinctively tried using the context manager in the way that you would for a requests Session/Client, but it errors. Cheers
@Carberra
@Carberra Жыл бұрын
Depends how it's implemented. In aiohttp, it's quicker to use a single session rather than create one every time (but you can actually use a context manager on that session itself I think, so may not be a problem at all). Idk how Boto3 stuff works haha
@fewunderstandthis7355
@fewunderstandthis7355 Жыл бұрын
@@Carberra ahh yes, rather than requests, the better comparison would have been aiohttp or httpx (which has similar api to requests). Ok thanks, I’ll try it out! Great content as always
Slots make Python FASTER and LEANER
9:30
Carberra
Рет қаралды 22 М.
Python's contextlib is a HIDDEN GEM
14:55
Carberra
Рет қаралды 12 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
БОЙКАЛАР| bayGUYS | 27 шығарылым
28:49
bayGUYS
Рет қаралды 1,1 МЛН
SAVE TIME and reduce boilerplate with dataclasses
18:58
Carberra
Рет қаралды 3,9 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 319 М.
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 67 М.
The Only Unbreakable Law
53:25
Molly Rocket
Рет қаралды 358 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 242 М.
5 Uncommon Python Features I Love
15:09
Indently
Рет қаралды 175 М.
How principled coders outperform the competition
11:11
Coderized
Рет қаралды 1,8 МЛН
Why You Should Think Twice Before Using Returns in Python
21:27
ArjanCodes
Рет қаралды 53 М.
JavaScript is weird
22:45
Carberra
Рет қаралды 996
The Absolute Best Intro to Monads For Software Engineers
15:12
Studying With Alex
Рет қаралды 680 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН