Generator[T, None, None] is one of those things that everyone knows about but most don't know why. It would be cool to have a video explaining what the other types are for
So excited about that change. I often violated the rule of maximum specificity in the return type and simply used a higher-in-hierarchy `Iterator[T]`, which is obviously not an equivalent: it was only suitable for cases where I didn't have to access `.send()`, `.throw()` or `.close()`; but that was the majority of cases. Nevertheless, so cool I can just use `Generator[T]` now. There are lots of other use cases, for example `textual.App[T]` with the `T` defaulting to `None`.
Hi Anthony. Thank you for such great content. It’s really hard to find intermediate/advanced python topics on youtube because most of the content is created for beginners and there’s no point to watch it if you already have at least some production experience. Keep up the great work. I’d like to ask you to record a video about Python memory management, how to write cpu/ram efficient code, tips & tricks, what to avoid and all python memory-cpu-related stuff, memory leaks, profiling, etc. (I watched a video about preloading & gc.freeze() it was really fun and cool stuff you did.)
it's difficult to pinpoint a strategy specifically -- at least when writing pure python you don't really have much control over it other than not globally caching things forever (and not using buggy C libraries!) -- that said here's a few others I've done about memory (explains videos are collected at github.com/anthonywritescode/explains) - using memray to debug a memory leak in krb5: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-bw5AHdZA7e4.html - don't lru_cache a method: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sVjtp6tGo0g.html - fixing a 9GB memory leak in cargo: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-uxJhAXdBlbc.html
maybe? probably not though -- tbh they're basically just context managers that let the event loop yield (if that makes any sense). I tend to stay way from python's async personally -- been really unimpressed with it and can't quite stomach the coloring problem it introduces. honestly multiprocessing / multithreading has been easier for me to write personally
@@iamcurrentlypooping thanks! I was recently going through the docs, and I don't recall seeing any deprecation warning, that's why I was confused. Looks I just overlooked it :-P