Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: Paulo da Silva Newsgroups: comp.lang.python Subject: Passing new fields to an object Date: Fri, 12 Jun 2015 16:53:08 +0100 Organization: Aioe.org NNTP Server Lines: 18 Message-ID: NNTP-Posting-Host: rpgRlhg9tMo1Vs7b/IQ9OA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.python:92534 I would like to do something like this: class C: def __init__(self,**parms): ... c=C(f1=1,f2=None) I want to have, for the object self.f1=1 self.f2=None for an arbitrary number of parameters. What is the best way to achieve this? Thanks