Louis Chan
Jul 6, 2021

Hi Sander,

Thanks for reading my blog post and for spending the time to comment the recommendation and corrections.

For point 1, I absolutely agree with you on that. A set of one element should have a object structure that takes up less memory than a tuple with a thousand. The actual memory usage of data structure would be beyond what sys.getsizeof returns. That being said, you are still spot on with the uniqueness point!

For point 2, I take the blame on not being specific enough. set objects do allow constant-cost membership test which will be the lowest among the three but the time complexity of constructing a set may outweigh it.

For point 3, kudos to you for correcting!

Again, very much appreciated for your response!

Louis Chan
Louis Chan

Written by Louis Chan

Learn from your own mistakes today makes you a better person tomorrow.

No responses yet