Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2324

Re: Alias for an attribute defined in a superclass

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 <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: Alias for an attribute defined in a superclass
References <87sju3ndjo.fsf@benfinney.id.au> <mailman.57.1301618196.2990.python-list@python.org>
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 <bignose+hates-spam@benfinney.id.au>
Date Fri, 01 Apr 2011 11:57:18 +1100
Message-ID <87d3l6okk1.fsf@benfinney.id.au> (permalink)
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

Show key headers only | View raw


Calvin Spealman <ironfroggy@gmail.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Alias for an attribute defined in a superclass Ben Finney <ben+python@benfinney.id.au> - 2011-04-01 09:14 +1100
  Re: Alias for an attribute defined in a superclass Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-01 00:14 +0000
    Re: Alias for an attribute defined in a superclass Ben Finney <ben+python@benfinney.id.au> - 2011-04-01 11:59 +1100
  Re: Alias for an attribute defined in a superclass Calvin Spealman <ironfroggy@gmail.com> - 2011-03-31 20:36 -0400
    Re: Alias for an attribute defined in a superclass Ben Finney <ben+python@benfinney.id.au> - 2011-04-01 11:57 +1100
  Re: Alias for an attribute defined in a superclass Raymond Hettinger <python@rcn.com> - 2011-03-31 19:24 -0700
    Re: Alias for an attribute defined in a superclass Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-04-01 11:54 +0200

csiph-web