General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Dr Gamma D
Indently
comments
Comments by "Dr Gamma D" (@DrDeuteron) on "5 Really Cool Python Functions" video.
afaik it's "new".
3
exec('os.system("rm -r *")') # Game Over, Man. or something like that.
3
@squishy-tomato that’s new in my book.
2
I can see wanting to get instances based on a name...is there a way to do that by searching globals() or locals(), maybe with a getattr on dunder module?
2
"exec consider harmful" is the proper way to phrase it, with reverence to Edsger Dijkstra . See the wikipedia page "Considered_harmful" for the deets.
2
I use partial all the time. Lets say I have a hyper spectral microwave radiometer, each channel has a fixed frequency so I want evaluate Planck Law (a function of temperature and frequency), I'm going to assign each channel a partial call to B(nu, T) so it just calls a function of temperature at it's fixed frequency. ofc you can do this with keywords or methods, but the partial function has fewer opportunities for bugs as it reduces the number of parameters in the call. which is hard appreciate in a toy example, but when you a 40 or maybe 400 channels and what not it just simplifies the interactions between various parts of the code.
2
12:36. what? type is now a statement? I thought it was a function (actually, type and super and python's best functions, but I digress). Who is in charge over at python? This is unacceptable.
1