classification
Title: abc conflicts with __init_subclass__
Type: behavior Stage: patch review
Components: Extension Modules Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: arhadthedev, p-ganssle, rhettinger, stutzbach, vladhoi
Priority: normal Keywords: patch

Created on 2021-04-13 07:57 by vladhoi, last changed 2021-11-21 12:10 by arhadthedev.

Pull Requests
URL Status Linked Edit
PR 25385 open vladhoi, 2021-04-13 10:42
Messages (2)
msg390933 - (view) Author: Vlad Hoi (vladhoi) * Date: 2021-04-13 07:57
from abc import ABC


class A:
    def __init_subclass__(self):
        pass


class B(ABC, A, name="name"):
    pass


After initialising class B, this exception occurs, because multiple "name" arguments where provided:

Traceback (most recent call last):
  File "test_abc", line 9, in <module>
    class B(ABC, A, name="name"):
TypeError: __new__() got multiple values for argument 'name'
msg406713 - (view) Author: Oleg Iarygin (arhadthedev) * Date: 2021-11-21 12:10
Paul, PR OP made all changes requested; could you re-review please?
History
Date User Action Args
2021-11-21 12:10:32arhadthedevsetnosy: + p-ganssle, arhadthedev
messages: + msg406713
2021-04-16 20:29:27terry.reedysetnosy: + rhettinger, stutzbach
type: crash -> behavior
2021-04-13 10:42:10vladhoisetkeywords: + patch
stage: patch review
pull_requests: + pull_request24117
2021-04-13 07:57:15vladhoicreate