All you need to not create shadow embedded names is that you do not want to stop yourself from using them, so when your code does this:
x.set(a)
you can still access the built-in set so that there are no conflicts, the only problem is that if you want to use set inside the class definition
class Entry(): def __init__(self, value): self.set(value) def set(self, value): self.value=value possible_values = set((1,2,3,4,5))
Inside the class definition - and only there - the built-in name is obscured, so you should consider which option you would prefer: an unlikely scenario where you need to use set to define a class scope variable and get an error or use an unintuitive name for your method.
Also note that if you like to use method names that make sense to you and also want to use set in the definition of your class, you can still access it via builtins.set for python 3 or __builtin__.set for python 2 .
source share