TypeError: 'kwarg' is an invalid keyword argument for this function

roro codeath rorocodeath at gmail.com
Sun Oct 12 14:55:51 CEST 2014


How to implement it in my class?

class Str(str):
    def __init__(self, *args, **kwargs):
        pass

Str('smth', kwarg='a')

# How to implement in my class

class C:
   def __init__(self):
       pass

class C2(C):
    def __init__(self, *args, **kwargs):
        pass
C2(kwarg='a')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141012/86b68dff/attachment.html>


More information about the Python-list mailing list