This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author iritkatriel
Recipients eric.araujo, iritkatriel, mjpieters, serhiy.storchaka, ztane
Date 2020-10-04.15:42:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601826175.03.0.267421469793.issue32112@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2020-10-04 15:42:55iritkatrielsetrecipients: + iritkatriel, mjpieters, eric.araujo, serhiy.storchaka, ztane
2020-10-04 15:42:55iritkatrielsetmessageid: <1601826175.03.0.267421469793.issue32112@roundup.psfhosted.org>
2020-10-04 15:42:55iritkatriellinkissue32112 messages
2020-10-04 15:42:54iritkatrielcreate