I’ve got a small problem which in itself isn’t a big deal but is bugging me none the less. Consider the code below. When passing vector as a parameter to pygame.Surface I have to use the ‘t’ attribute to access the tuple stored in ‘size’. Is there a way to have it simply like this? Is there a magic method
Tag: magic-methods
How does python numpy.where() work?
I am playing with numpy and digging through documentation and I have come across some magic. Namely I am talking about numpy.where(): How do they achieve internally that you are able to pass something like x > 5 into a method? I guess it has something to do with __gt__ but I am looking for a detailed explanation. Answer How