Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone02.am1.xlned.com!bcyclone02.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.052 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; "subject:' ": 0.07; '*args,': 0.09; 'def': 0.12; '**kwargs):': 0.16; 'pass': 0.26; 'message-id:@mail.gmail.com': 0.30; 'class': 0.32; 'skip:_ 10': 0.34; 'received:google.com': 0.35; 'implement': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'subject:this': 0.83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=H7kIH0/UT0o2995tpJFxypryTCREQzfMXFUszAj1QHE=; b=aVtBodQyEQD+o261+dB92s0B9wkqZWKuN//5Ss9qL+Z+ArmGdF/ZOmXyDABvMP08cU 6UL/ThXzsgSgxbqesLSJe+vwl1wxCNuHLegHQKErVRc9sii38i1f7MIgSRJNjuHwjGug H241vd9TUku/v2xjIgUgffVEMnxVekYrgwotfBbocVi2Z8NQXgjNEHfWo+irlWIDutFh eqNWG1+cWM5aE3XMdba1udKskO8hTntnWQdUXCKtT3WxQnWnMVp2rs+Oo/Ny40wTJ3Yt iVYso0rWkJjOfhTLot6f63txCWdrS6UoBgbffk7Zmgag0cGCCf9eysh/r27dY5VI14bN fO0w== MIME-Version: 1.0 X-Received: by 10.224.60.129 with SMTP id p1mr29265513qah.99.1413118551709; Sun, 12 Oct 2014 05:55:51 -0700 (PDT) Date: Sun, 12 Oct 2014 20:55:51 +0800 Subject: TypeError: 'kwarg' is an invalid keyword argument for this function From: roro codeath To: python-list@python.org Content-Type: multipart/alternative; boundary=001a11c3d8d44cde4f0505394d08 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413118559 news.xs4all.nl 2974 [2001:888:2000:d::a6]:60461 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3745 X-Received-Body-CRC: 934710323 Xref: csiph.com comp.lang.python:78995 --001a11c3d8d44cde4f0505394d08 Content-Type: text/plain; charset=UTF-8 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') --001a11c3d8d44cde4f0505394d08 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
How to implement it in my class?

c= lass Str(str):
=C2=A0 =C2=A0 def __init__(self, *args, **kwargs):=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 pass

Str(&#= 39;smth', kwarg=3D'a')

# How to implem= ent in my class

class C:
=C2=A0 =C2=A0de= f __init__(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0pass

<= /div>
class C2(C):
=C2=A0 =C2=A0 def __init__(self, *args, **= kwargs):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 pass
C2(kwarg=3D&#= 39;a')





--001a11c3d8d44cde4f0505394d08--