New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set.__or__, __and__, etc create subclass types, but ignore __new__ #60083
Comments
If they are not going to call the metaclass or the class new, then they should return As it is, the results of set operations receive some subclass information but not all. So they are not really obeying the notion of a subclass: the results are neither e.g. x = Fooset([1,2,5])
y = x|x The object |
It is probably true that this is a bug, but subclasses of mutable classes do not normally override __new__. (I'm curious what your use case is for doing so.) |
This was already fixed (in the 3.x releases) by bpo-1721812. |
The closing author is correct, the use case is adequately covered by __init__, and that has been fixed in 3. It makes sense this will not be backported. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: