Brian R Yes, I agree with you. Faheem Hossain Your code was really helpful... But I too am wondering about the same thing. Edit: I found this https://stackoverflow.com/questions/21734658/performance-discrepancy-obj-setitem-x-y-vs-objx-y from Stack Overflow, which is kind of related to this question... But still, I couldn't find a satisfactory answer.
to be honest im not sure which is actually faster. if i had to guess, its the exact same. if one method was faster than the other, the difference is so small that it doesn't actually make a difference in the run time of your program. you should refrain from calling "magic methods" directly because python has better methods of doing these things that are more "pythonic". remember: python emphasizes readability, so whatever seems easier to understand when reading the program is probably the "right way" of doing it.