[wxPython-users] Best practice to rganize the code

Tim van der Leeuw tnleeuw at gmail.com
Tue Mar 18 08:04:37 PDT 2008


Self - overdose?

As long as you're not assigning new values to variables from self, but only
updating mutable objects or reading existing values, you can hack:

locals().update(self.__dict__)

(Let me quickly run for cover, and hide out somewhere ;-) )

Cheers, and oh, don't you try that at home!

--Tim

On Tue, Mar 18, 2008 at 3:30 PM, Peter Damoc <pdamoc at gmail.com> wrote:


> as for self overdose... it is a double edge sword. I understand the
> benefits of explicitness but I also like to be able to define context.
> This is what wxpita does IMHO. You provide the names for the components
> and it uses the context to mount the objects.
>
> Good luck.
>
> Peter
>
>
> On Tue, Mar 18, 2008 at 3:57 PM, Stef Mientki <s.mientki at ru.nl> wrote:
>
> > hi Peter,
> >
> > Peter Damoc wrote:
> > > >From what I've understood from Feihong (wxpita creator) the code is
> > > in for a redesign.
> > > It does the job even now BUT its usability depends on how you are used
> > > to program.
> > > Right now is geared towards quick scripting.
> > >
> > After doing just a few forms with my scripting,
> > I'm so enthusiast that I'm going to do all my new forms with it,
> > and translate every old form when I touch it.
> > So it will finally satisfy all my needs.
> > > The part where you didn't understood it is normal. You have to first
> > > understand the problem its trying to solve.
> > > For me the lights turned on when I saw how little "self"
> > I don't think this is a blessing,
> > when I started Python about a year ago,
> > I tried to avoid self as much as possible,
> > tried to create the "with" clause from Delphi,
> > used for a while "s" instead of self,
> > but finally got back to self, and now I think it's a good thing.
> > > and sizer stuff was in the code. :)
> > My implementation even doesn't allow sizers ;-)
> > > I'm saturated on "self".
> > Then just don't write object oriented programs ;-)
> > >
> > > Peter
> > >
> > cheers,
> > Stef
> >
> >
> > Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in
> > het handelsregister onder nummer 41055629.
> > The Radboud University Nijmegen Medical Centre is listed in the
> > Commercial Register of the Chamber of Commerce under file number 410556=
29.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> > For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
> >
> >
>
>
> --
> There is NO FATE, we are the creators.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200803=
18/105126d2/attachment.htm


More information about the wxpython-users mailing list