Thanks for the python short series, looking for new tips!
@mikeckennedy2 жыл бұрын
Glad you like them!
@10a3asd2 жыл бұрын
rad, love these. very helpful
@mikeckennedy2 жыл бұрын
Thanks so much!
@karpilenko2 жыл бұрын
Thanks Michael! Very useful info on merging dictionaries, but HOLY COW how I didn't know about this - f'{query=}' use of f-strings? This is SO CONVENIENT! This going to save me so much time! (of course not for debugging with print statements ha ha who does that amiright)
@mikeckennedy2 жыл бұрын
It is super convenient! f-strings just keep on giving. BTW, check out flynt to convert older code to f-string style if you want to upgrade easily.
@smellypunks2 жыл бұрын
Just blown my mind! Time to upgrade to 3.10
@mikeckennedy2 жыл бұрын
Nice, thanks Cam! Technically, this will work in 3.9 and above (I was offer by one on my version requirements).
@PaulJacobson2 жыл бұрын
This is awesome!
@mikeckennedy2 жыл бұрын
Thanks Paul!
@decromax2 жыл бұрын
Nice! I'm so used to ** i'ts going to be hard to break the habit :) - I do like how clean the syntax is though.
@mikeckennedy2 жыл бұрын
It is cool syntax but will take some getting use do. I only have previously used that style for type declarations (like: int | str ).
@meowvee2 жыл бұрын
If you are not modifying the merged dictionary, there is another way: Using collections.ChainMap
@mikeckennedy2 жыл бұрын
Good to know, thanks Hai.
@exchangevisual62522 жыл бұрын
Solid Solid
@mikeckennedy2 жыл бұрын
Thanks!
@brandonbraner2 жыл бұрын
I still think I like the ** sort of destructering way. Maybe I am just used to it but my brain doesn’t want to grasp the pipe… maybe over time. Great video
@mikeckennedy2 жыл бұрын
Thanks Brandon. I agree that I'd probably start writing **dict first. :)
@notnull012 жыл бұрын
Method 3 its pretty cool, but for me i personally do option 2 it's just more readable..
@mikeckennedy2 жыл бұрын
I agree, method 2 and 3 are pretty similar!
@motehpro2 жыл бұрын
This is actually available from Python 3.9 :) Nice video though