Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news-xfer.nntp.sonic.net!news.astraweb.com!border6.newsrouter.astraweb.com!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: Alias for an attribute defined in a superclass References: <87sju3ndjo.fsf@benfinney.id.au> X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney Date: Fri, 01 Apr 2011 11:57:18 +1100 Message-ID: <87d3l6okk1.fsf@benfinney.id.au> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:E1VBK9w58TPtZ6lz1wXGtMdjFBE= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Lines: 17 Organization: Unlimited download news at news.astraweb.com NNTP-Posting-Host: 9ff75274.news.astraweb.com X-Trace: DXC=AI\dI6PP]PiMm1IZKF?@MbL?0kYOcDh@jSBc;\8ijUdkQS[jEnCJZXaUGD@iN[Hd?odKF`JIMc=\g Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2324 Calvin Spealman writes: > Sounds like you're just going to end up with more confusing code > having multiple ways to refer to the exact same thing. Why? (Why did you top-post?) I'm defining aliases to conform to an existing API. The “Foo” class's attributes are what is needed, but not by the right names. So I'm making a subclass “Bar” to provide those same attributes by the names required by the third-party API. -- \ “He that loveth father or mother more than me is not worthy of | `\ me: and he that loveth son or daughter more than me is not | _o__) worthy of me.” —Jesus, as quoted in Matthew 10:37 | Ben Finney