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


Groups > comp.lang.python > #19288 > unrolled thread

Re: Using an object inside a class

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2012-01-23 14:21 -0700
Last post2012-01-23 14:21 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Using an object inside a class Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-23 14:21 -0700

#19288 — Re: Using an object inside a class

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-01-23 14:21 -0700
SubjectRe: Using an object inside a class
Message-ID<mailman.4985.1327353746.27778.python-list@python.org>
On Mon, Jan 23, 2012 at 1:58 PM, MRAB <python@mrabarnett.plus.com> wrote:
>> Either way would work but the main issue is I can't seem to use foo or
>> foo.bar or foo.bar.object anywhere in __init__ or even before that in
>> the main class area.
>>
> This line:
>
> foo = MyApp(0)
>
> will create a 'MyApp' instance and then bind it to the name 'foo'.
> Until that binding occurs, the name 'foo' doesn't exist.

What MRAB said; also note that there is no need to bind your wx.App
instance to a name at all, because you can retrieve it globally by
calling wx.GetApp().

Cheers,
Ian

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web