Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #45335
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <oscar.j.benjamin@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'heavily': 0.04; 'receives': 0.04; 'subject:Python': 0.06; 'problem:': 0.07; '__init__': 0.09; 'arguments': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'accepting': 0.14; 'anyway': 0.14; '2.7.3?': 0.16; 'args,': 0.16; 'article:': 0.16; 'cc:name:python list': 0.16; 'conclusion:': 0.16; 'positional': 0.16; 'subject: \n ': 0.16; 'those,': 0.16; 'workaround:': 0.16; 'essential': 0.16; 'wrote:': 0.18; 'producing': 0.19; 'seems': 0.21; '(the': 0.22; 'cc:addr:python.org': 0.22; 'subject:problem': 0.24; 'cc:2**0': 0.24; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'generally': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'keywords,': 0.31; 'relies': 0.31; 'workaround': 0.31; 'class': 0.32; 'problem': 0.35; 'subject:with': 0.35; 'advice': 0.35; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'keyword': 0.36; 'received:209': 0.37; 'implement': 0.38; 'that,': 0.38; 'skip:u 10': 0.60; 'solve': 0.60; 'first': 0.61; 'to:addr:gmail.com': 0.65; 'results': 0.69; 'oscar': 0.84; 'subject: *': 0.84; 'subject:skip:o 10': 0.84; 'dirty': 0.93; '2013': 0.98 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=MG3mY4zLV4+3NoyBGMMAdA1Sw3D/WxVpALk/T47mj3E=; b=tYXSiKdZvXDIU6LfMEjtUIw6lgWdkxwZ0I4wiEGl21dT6PqTjdUB9Orom8z9QRR1q2 pK4Ok2Vl2yMIDyfPZYwfeHwyaXM8JOmqGnxzl69G8M1kJszz/tUvZynC10rmH3dTaYzA 8JfUpQyercpyYpdSGPXsUwwHxfAUcvYGkvvZGhe47p0Xx/fQVgvOfkwqLSncfxKz8PWf 0ROCTdbjPgWx6c3vq79lZvYMENSoi1cijziSqzdyauy0c1DYWyhf1Lx6CDkKc+W5HyQy AHizryCH6WisIn4bft1Dv3Tl3yqKlRf1yJ3o17YxqwCtlcTtoKoy4uWBmBcuTapjEojf tQxg== |
| X-Received | by 10.58.161.6 with SMTP id xo6mr24221786veb.50.1368620189451; Wed, 15 May 2013 05:16:29 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <f4ce525a-2728-4ad6-9858-e9005534ee54@bz1g2000vbb.googlegroups.com> |
| References | <f4ce525a-2728-4ad6-9858-e9005534ee54@bz1g2000vbb.googlegroups.com> |
| From | Oscar Benjamin <oscar.j.benjamin@gmail.com> |
| Date | Wed, 15 May 2013 13:16:09 +0100 |
| Subject | Re: Python 2.7.x - problem with obejct.__init__() not accepting *args and **kwargs |
| To | wzab <wzab01@gmail.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Cc | Python List <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1695.1368620192.3114.python-list@python.org> (permalink) |
| Lines | 33 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1368620192 news.xs4all.nl 15921 [2001:888:2000:d::a6]:43310 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:45335 |
Show key headers only | View raw
On 15 May 2013 12:18, wzab <wzab01@gmail.com> wrote: > I had to implement in Python 2.7.x a system which heavily relies on > multiple inheritance. > Working on that, I have came to very simplistic code which isolates > the problem: > (The essential thing is that each base class receives all arguments > and uses only those, > which it understands). > [snip] > > I have found a workaround: > > # Class my_object added only as workaround for a problem with > # object.__init__() not accepting any arguments. [snip] > > The above works correctly, producing the same results as the first > code in Python 2.5.2, > but anyway it seems to me just a dirty trick... > What is the proper way to solve that problem in Python 2.7.3? I don't generally use super() but I did see some advice about it in this article: https://fuhm.net/super-harmful/ >From the conclusion: "Never use positional arguments in __init__ or __new__. Always use keyword args, and always call them as keywords, and always pass all keywords on to super." Oscar
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python 2.7.x - problem with obejct.__init__() not accepting *args and **kwargs wzab <wzab01@gmail.com> - 2013-05-15 04:18 -0700
Re: Python 2.7.x - problem with obejct.__init__() not accepting *args and **kwargs Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-05-15 13:16 +0100
Re: Python 2.7.x - problem with obejct.__init__() not accepting *args and **kwargs Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-16 02:06 +0000
Re: Python 2.7.x - problem with obejct.__init__() not accepting *args and **kwargs Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-16 00:37 -0600
Re: Python 2.7.x - problem with obejct.__init__() not accepting *args and **kwargs Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-05-16 11:31 +0100
Re: Python 2.7.x - problem with obejct.__init__() not accepting *args and **kwargs Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-15 09:41 -0600
csiph-web