Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone02.am1.xlned.com!bcyclone02.am1.xlned.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.050 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'classes.': 0.07; 'python': 0.11; 'definition.': 0.16; 'inheritance': 0.16; 'thought.': 0.16; 'flexibility': 0.18; 'say,': 0.18; 'runs': 0.18; 'class,': 0.22; 'enforce': 0.22; 'suppose': 0.22; 'module': 0.23; 'written': 0.24; 'message-id:@mail.gmail.com': 0.28; "i'm": 0.29; 'parent': 0.29; 'post': 0.32; 'class': 0.33; 'problem': 0.33; 'another': 0.34; 'skip:& 10': 0.34; 'received:google.com': 0.34; 'to:addr:python- list': 0.35; 'but': 0.36; 'list,': 0.36; 'there': 0.36; "let's": 0.36; 'should': 0.37; 'skip:i 20': 0.37; 'names': 0.38; 'method': 0.39; 'to:addr:python.org': 0.39; 'seem': 0.39; 'subject:-': 0.39; 'within': 0.64; 'different': 0.64; 'between': 0.65; 'behaviors': 0.72; 'collision': 0.84 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=TPbbpdpMo5PTR8uka8PvAVXhuyKcw0Z3Lw2DqmWWnmM=; b=GpwFjOepsmjzjS0J0NUJBDMk84qZX9h1TtN1xzyhedgBSoqtuOKtyCXfqaCxlgtt1V nDmFUnBdgHcNf3V77/hkSvC+BLIVXLAlC/Sf9jrxCp3E68MVA7Gc9lmcdu4If686AOXx 2HsBPLPTjByJfXul+uD7JC/HwvRqP788Q9qvUwnh6tCN/8RakyiEUHf6Qu/m2pCk1SgH cWLakIT5ArNKN8Thjj1jQd80MAreghylnZ4OWEm38Nnyni7Lo3VO+I+5Hgp8jo3nyX9F DqMM8OYlx7FifN9W+MyFxN21PrQK1TQ7s9BEPTfATs3e1+KRqTnFnqdwsjhR1AZP9uns mXJA== MIME-Version: 1.0 X-Received: by 10.202.105.13 with SMTP id e13mr11763120oic.48.1432432409813; Sat, 23 May 2015 18:53:29 -0700 (PDT) Date: Sat, 23 May 2015 20:53:29 -0500 Subject: mix-in classes From: "Dr. John Q. Hacker" To: python-list@python.org Content-Type: multipart/alternative; boundary=001a1140918ef3a6940516ca2880 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432432413 news.xs4all.nl 2935 [2001:888:2000:d::a6]:34387 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 5063 X-Received-Body-CRC: 2644616250 Xref: csiph.com comp.lang.python:91155 --001a1140918ef3a6940516ca2880 Content-Type: text/plain; charset=UTF-8 The post on "different types of inheritence..." brought up a thought. Let's say, I'm adding flexibility to a module by letting users change class behaviors by adding different mix-in classes. What should happen when there's a name collision on method names between mix-ins? Since they're mix-ins, it's not presumed that there is any parent class to decide. The proper thing would seem to call each method in the order that they are written within the parent class definition. I suppose one can create a method in the parent class, that runs the mixin methods in the same order as in the inheritance list, but would there be a better way for Python to enforce such a practice so as not to create class anarchy? (A problem for another topic.) zipher --001a1140918ef3a6940516ca2880 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The post on "different types of inheritence..." brought up a thought.<= br>
Let's say, I'm addi= ng flexibility to a module by letting users change class behaviors by addin= g different mix-in classes.

What should happen when there's a name collision on method names betwe= en mix-ins?=C2=A0 Since they're mix-ins, it's not presumed that the= re is any parent class to decide.=C2=A0 The proper thing would seem to call= each method in the order that they are written within the parent class def= inition.

I suppose one can = create a method in the parent class, that runs the mixin methods in the sam= e order as in the inheritance list, but would there be a better way for Pyt= hon to enforce such a practice so as not to create class anarchy?=C2=A0 (A = problem for another topic.)

zipher

--001a1140918ef3a6940516ca2880--