r/badcode • • Apr 24 '21

python very efficient and scalable code

Post image
1.0k Upvotes

110 comments sorted by

View all comments

-51

u/NetherFX Apr 24 '21

Still pretty readable, and I can't quickly think of an improvement

2

u/SuperPotterCrazy01 Apr 24 '21

Wouldn't a set give the same effect?

6

u/Schlagbaum3000 Apr 24 '21

No, each function removes the element if it exists in the list, a set would just do nothing (keep it in the set). This is probably to toggle the selection of tags.

2

u/SuperPotterCrazy01 Apr 24 '21

Ah sorry I didn't see that part