Raymond Hettinger wrote:
On Mar 31, 3:14 pm, Ben Finney wrote:
Howdy all,
I want to inherit from a class, and define aliases for many of its
attributes. How can I refer to “the attribute that will be available by
name ‘spam’ once this class is defined”?
class Foo(object):
def s
On Mar 31, 3:14 pm, Ben Finney wrote:
> Howdy all,
>
> I want to inherit from a class, and define aliases for many of its
> attributes. How can I refer to “the attribute that will be available by
> name ‘spam’ once this class is defined”?
>
> class Foo(object):
> def spam(self):
>
Steven D'Aprano writes:
> On Fri, 01 Apr 2011 09:14:03 +1100, Ben Finney wrote:
>
> > I want to inherit from a class, and define aliases for many of its
> > attributes.
>
> Are these aliases of arbitrary aliases, or only of methods, as in your
> example below?
I'd like to know how to do either,
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 ri
Sounds like you're just going to end up with more confusing code
having multiple ways to refer to the exact same thing. Why?
On Thu, Mar 31, 2011 at 6:14 PM, Ben Finney wrote:
> Howdy all,
>
> I want to inherit from a class, and define aliases for many of its
> attributes. How can I refer to “the
On Fri, 01 Apr 2011 09:14:03 +1100, Ben Finney wrote:
> Howdy all,
>
> I want to inherit from a class, and define aliases for many of its
> attributes.
Are these aliases of arbitrary aliases, or only of methods, as in your
example below?
> How can I refer to “the attribute that will be avail