There is no problem using names that also are used as methods on some objects. Different namespaces won't conflict.
The only thing you need to worry about are masking names in the same namespace; built-ins are global, globals are visible in the local namespace, so you don't want to mask built-in names.
But methods on an object are only visible to that scope; you need to qualify the method with someset.union()
, which can never conflict with your union()
function.
If you did have to restrict your names to anything that is not already taken by a method in the Python standard library, you would have scarcely have any names left to use.