Dennis Sweeney <sweeney.dennis...@gmail.com> added the comment:

Here's an example:

class A(complex):
    def __init__(self, *args, test):
        self.test = test
    def __new__(cls, *args, test):
        return super().__new__(cls, *args)

>>> a = A(1, test="TEST")
>>> a
(1+0j)
>>> a.test
'TEST'

>>> b = A(1, 1, test="TEST2")
>>> b
(1+1j)
>>> b.test
'TEST2'

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42334>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to