[issue32112] Should uuid.UUID() accept another UUID() instance?

2020-12-18 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> rejected stage: -> resolved status: open -> closed type: -> enhancement ___ Python tracker ___

[issue32112] Should uuid.UUID() accept another UUID() instance?

2020-10-04 Thread Irit Katriel
Irit Katriel added the comment: 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).

[issue32112] Should uuid.UUID() accept another UUID() instance?

2017-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Growing the size of the code and the documentation, complicating the mental model, slowing down all other cases, the risk of introducing bugs. This is the cost that we should pay for adding a new feature. The benefit of adding a

[issue32112] Should uuid.UUID() accept another UUID() instance?

2017-11-24 Thread Éric Araujo
Éric Araujo added the comment: I don’t see a downside in accepting the feature request here. Maybe ask on python-ideas to get more feedback? -- nosy: +eric.araujo ___ Python tracker

[issue32112] Should uuid.UUID() accept another UUID() instance?

2017-11-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Not always the constructor accept an instance of the same class. I'm sure that this is not true in the majority of cases. The constructor of int accepts an instance of int and the constructor of tuple accepts an instance of

[issue32112] Should uuid.UUID() accept another UUID() instance?

2017-11-22 Thread Antti Haapala
Antti Haapala added the comment: I've been hit by this too, in similar contexts, and several times. It is really annoying that it is easier to coerce an UUID or UUID-string to a string than to coerce to a UUID. Usually when the copy semantics are clear and the class is

[issue32112] Should uuid.UUID() accept another UUID() instance?

2017-11-22 Thread Martijn Pieters
New submission from Martijn Pieters : When someone accidentally passes in an existing uuid.UUID() instance into uuid.UUID(), an attribute error is thrown because it is not a hex string: >>> import uuid >>> value = uuid.uuid4() >>> uuid.UUID(value) Traceback (most recent call