I agree with Serhiy that there needs to be a reason for adding this to a class constructor.
In the case of int, this is to implement conversion - it's not accepting int, it's accepting any number (it would be weird of int(3.4) worked and int(3) didn't). Similarly, complex constructor accepts numbers.
In the case of tuple, bytes, bytearray - the constructor accepts any iterable, again in order to implement type conversion.
So it's not random - these constructors accept objects of the same type because they accept params of a more generic type, in order to provide type conversion functionality.
What functionality would we gain from increasing the API surface of the UUID constructor as you suggest? |