If you have a method called “set” in a class and want to create a standard builtin “set” object somewhere else in the class, Python seems to reference the method when I do that. How can you be more specific to let Python know you mean the builtin “set”, not the method “set”? More specifically, set() is being created in an _____exit_____ function.
Share
I think I know what’s going on here. Are you doing something like this?
This is a subtle problem due to the way methods are defined in classes. It is what allows you to make method aliases so easily, e.g.,
You can either put
setat the bottom of your class definition, or you can refer to the builtin set using__builtins__.set.