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 jaraco
Recipients brandtbucher, jaraco, rhettinger, serhiy.storchaka
Date 2021-09-17.13:53:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1631886827.63.0.354405622408.issue43413@roundup.psfhosted.org>
In-reply-to
Content
>> Subclass of set can now define
> Is there any use case for this?

Is your concern about a use-case for the general concept or for set specifically?

I appreciate that Serhiy has taken the time to evaluate the specific concern I raised and extrapolate it to the implications for most/all built-in types. It seems worthwhile to me that built-in types have consistent behaviors. Moreover, it seems preferable to provide the intuitive behavior (allowing simply overriding `__new__`) without the baggage of needing to define `__init__`. I'd not be surprised if there was a real-world use-case in which `set.__new__` was overridden in a subclass and the user was forced to add an `__init__` just to bypass "set() takes no keyword arguments". Interestingly, searching the web for that exact error doesn't emit any results, so if someone has encountered it, it wasn't posted with the error message.

After exploring this some, I'm convinced there may not be a strong case for this behavior.

Raymond, if this new behavior was removed, how would you propose to rewrite the test (specifically https://github.com/python/cpython/blob/778b07565e38cc94aa90318eb47b9cd09716756a/Lib/test/test_set.py#L665-L673)?
History
Date User Action Args
2021-09-17 13:53:47jaracosetrecipients: + jaraco, rhettinger, serhiy.storchaka, brandtbucher
2021-09-17 13:53:47jaracosetmessageid: <1631886827.63.0.354405622408.issue43413@roundup.psfhosted.org>
2021-09-17 13:53:47jaracolinkissue43413 messages
2021-09-17 13:53:47jaracocreate