Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #21493
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news2.arglkargh.de!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'classes.': 0.05; 'all?': 0.09; 'overridden': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'am,': 0.12; 'class,': 0.15; 'attribute,': 0.16; 'creation.': 0.16; 'mro': 0.16; 'new-style': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:t-dialin.net': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'from:addr:web.de': 0.23; "shouldn't": 0.23; 'function': 0.27; 'class': 0.29; '(and': 0.30; 'kelly': 0.30; 'sun,': 0.30; 'url:library': 0.31; 'cases': 0.32; 'idea': 0.32; 'there': 0.33; 'header:User-Agent:1': 0.33; 'header:X-Complaints-To:1': 0.34; 'stores': 0.34; 'probably': 0.35; 'to:addr:python-list': 0.35; 'url:python': 0.35; 'received:org': 0.36; 'but': 0.37; 'using': 0.37; 'url:org': 0.39; 'cannot': 0.39; 'to:addr:python.org': 0.40; "you'll": 0.61; 'provided': 0.62; '11,': 0.68; 'directly.': 0.68 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Peter Otten <__peter__@web.de> |
| Subject | Re: newb __init__ inheritance |
| Date | Sun, 11 Mar 2012 13:12:25 +0100 |
| Organization | None |
| References | <1c6db866-6fa3-4de5-96de-51d6720a1300@x17g2000yqj.googlegroups.com> <jjg4p3$lst$1@theodyn.ncf.ca> <jjglmi$dao$1@theodyn.ncf.ca> <2feb13ca-f83b-4843-995f-ee77e7505ecd@db5g2000vbb.googlegroups.com> <mailman.560.1331462311.3037.python-list@python.org> <18769501.3541.1331463388634.JavaMail.geo-discussion-forums@ynkz21> <CALwzidnxW5g9kSq+RBtOX5u_EHcevGbX3wqZJcHDc5KFSUwOCA@mail.gmail.com> <CALwzidmYk3sYyoupf=esOXc4OezVsbWh3AB8S-FTp_yNyqFRjg@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="ISO-8859-1" |
| Content-Transfer-Encoding | 7Bit |
| X-Gmane-NNTP-Posting-Host | p5084a06c.dip.t-dialin.net |
| User-Agent | KNode/4.7.3 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| 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.565.1331467945.3037.python-list@python.org> (permalink) |
| Lines | 19 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1331467945 news.xs4all.nl 6981 [2001:888:2000:d::a6]:50043 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:21493 |
Show key headers only | View raw
Ian Kelly wrote: > On Sun, Mar 11, 2012 at 5:40 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote: >>> 2. Is the mro function available only on python3? >> >> No, but it is available only on new-style classes. If you try it on a >> classic class, you'll get an AttributeError. > > And by the way, you probably shouldn't call the mro method directly. > That method is provided so that it can be overridden in order to > customize the MRO at class creation. The proper (and faster) way to > look up the MRO for a class is using the __mro__ attribute, which > stores the result of the mro method when the class is initialized. > > http://docs.python.org/library/stdtypes.html?highlight=mro#class.__mro__ Is it a good idea to use mro() or __mro__ at all? Are there common use cases that cannot be addressed with super()?
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
newb __init__ inheritance hyperboogie <hyperboogie@gmail.com> - 2012-03-08 07:25 -0800
Re: newb __init__ inheritance Maarten <maarten.sneep@knmi.nl> - 2012-03-08 08:30 -0800
Re: newb __init__ inheritance Peter Otten <__peter__@web.de> - 2012-03-08 18:03 +0100
Re: newb __init__ inheritance Ethan Furman <ethan@stoneleaf.us> - 2012-03-08 09:34 -0800
Re: newb __init__ inheritance "Colin J. Williams" <cjw@ncf.ca> - 2012-03-10 12:58 -0500
Re: newb __init__ inheritance "Colin J. Williams" <cjw@ncf.ca> - 2012-03-10 17:47 -0500
Re: newb __init__ inheritance hyperboogie <hyperboogie@gmail.com> - 2012-03-11 03:18 -0700
Re: newb __init__ inheritance Chris Rebert <clp2@rebertia.com> - 2012-03-11 03:38 -0700
Re: newb __init__ inheritance hyperboogie <hyperboogie@gmail.com> - 2012-03-11 03:56 -0700
Re: newb __init__ inheritance Chris Rebert <clp2@rebertia.com> - 2012-03-11 04:37 -0700
Re: newb __init__ inheritance Ian Kelly <ian.g.kelly@gmail.com> - 2012-03-11 05:40 -0600
Re: newb __init__ inheritance Ian Kelly <ian.g.kelly@gmail.com> - 2012-03-11 05:52 -0600
Re: newb __init__ inheritance Peter Otten <__peter__@web.de> - 2012-03-11 13:12 +0100
Re: newb __init__ inheritance hyperboogie <hyperboogie@gmail.com> - 2012-03-11 03:56 -0700
Re: newb __init__ inheritance hyperboogie <hyperboogie@gmail.com> - 2012-03-12 02:09 -0700
csiph-web