Message377949
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? |
|
Date |
User |
Action |
Args |
2020-10-04 15:42:55 | iritkatriel | set | recipients:
+ iritkatriel, mjpieters, eric.araujo, serhiy.storchaka, ztane |
2020-10-04 15:42:55 | iritkatriel | set | messageid: <1601826175.03.0.267421469793.issue32112@roundup.psfhosted.org> |
2020-10-04 15:42:55 | iritkatriel | link | issue32112 messages |
2020-10-04 15:42:54 | iritkatriel | create | |
|