wxPython - wx package (new style wxPython?)

Discussion in 'Python' started by Logan, Nov 26, 2003.

  1. Logan

    Logan Guest

    Would you recommend to use the wx package of wxPython?

    From the documentation:

    Provides a way to drop the wx prefix from wxPython objects by
    dynamically loading and renaming objects from the real wxPython
    package. This is the first phase of a transition to a new style
    of using wxPython. For example:

    import wx
    class MyFrame(wx.Frame):
    ...

    instead of:

    from wxPython.wx import *
    class MyFrame(wxFrame):
    ...

    What does 'this is the first phase of a transition to a new style
    using wxPython' in the above mean? Will this new style become the
    only way to use wxPython in future releases?

    Thanks in advance for any answers.

    --
    mailto: logan@phreaker(NoSpam).net
    Logan, Nov 26, 2003
    #1
    1. Advertising

  2. Logan

    Ben Finney Guest

    On Wed, 26 Nov 2003 01:01:59 +0100, Logan wrote:
    > Would you recommend to use the wx package of wxPython?


    Because it removes the redundancy in the module object names, yes. As
    for any other qualities the 'wx' package might have, I can't say; if
    it's exactly the same functionality and call styles as the existing
    wxPython.wx then I can't see a reason not to use it.

    > From the documentation:
    >
    > Provides a way to drop the wx prefix from wxPython objects by
    > dynamically loading and renaming objects from the real wxPython
    > package. This is the first phase of a transition to a new style
    > of using wxPython.
    >
    > What does 'this is the first phase of a transition to a new style
    > using wxPython' in the above mean? Will this new style become the
    > only way to use wxPython in future releases?


    'from foo import *' is heavily deprecated in any case; this "new style
    of using wxPython" is merely saying (AIUI) that the 'wx' package allows
    a more natural usage of wxPython objects without needing to use a
    deprecated import style.

    --
    \ "Quidquid latine dictum sit, altum viditur." ("Whatever is |
    `\ said in Latin, sounds profound.") -- Anonymous |
    _o__) |
    Ben Finney <http://bignose.squidly.org/>
    Ben Finney, Nov 26, 2003
    #2
    1. Advertising

  3. Logan

    James Tanis Guest

    Bah, I think they are just over-glorifying the change. In my
    mind, it's the same exact thing. The only real different is when you
    "from wxPython.wx import *" it reads everything into your local
    namespace which is traditionally considered not the best thing to do.
    I really have no idea if the "transition" when finished will remain
    backwards compatible, but I'm guessing from the description of the
    implementation that it is.

    BTW, In the future you may want to use a real email address so that you
    can receive an answer.

    On Tue, 2003-11-25 at 19:01, Logan wrote:
    > Would you recommend to use the wx package of wxPython?
    >
    > >From the documentation:

    >
    > Provides a way to drop the wx prefix from wxPython objects by
    > dynamically loading and renaming objects from the real wxPython
    > package. This is the first phase of a transition to a new style
    > of using wxPython. For example:
    >
    > import wx
    > class MyFrame(wx.Frame):
    > ...
    >
    > instead of:
    >
    > from wxPython.wx import *
    > class MyFrame(wxFrame):
    > ...
    >
    > What does 'this is the first phase of a transition to a new style
    > using wxPython' in the above mean? Will this new style become the
    > only way to use wxPython in future releases?
    >
    > Thanks in advance for any answers.
    >
    > --
    > mailto: logan@phreaker(NoSpam).net
    James Tanis, Nov 26, 2003
    #3
  4. Logan

    Logan Guest

    On Tue, 25 Nov 2003 19:20:08 -0500, James Tanis wrote:
    > BTW, In the future you may want to use a real email address
    > so that you can receive an answer.


    Thanks for your comments regarding my question.

    About the 'real email address':

    I do use a real address! You can find the address in the
    signatures of my postings; just remove the part saying '(NoSpam)'.

    I don't use the real address in the headers of my postings
    (but: am) because the last time (about a
    month ago) I used my real address, I got thousands and thousands
    of SPAM mails, viruses etc. per week. This was really annoying.

    --
    mailto: logan@phreaker(NoSpam).net
    Logan, Nov 26, 2003
    #4
  5. Logan

    Mark Hahn Guest

    I just finished a moderate sized wxPython app from scratch using wx and I'm
    happy I did. There were a few times I had to put my thinking cap on, but it
    worked out well.

    "Logan" <> wrote in message
    news:p...
    > Would you recommend to use the wx package of wxPython?
    >
    > From the documentation:
    >
    > Provides a way to drop the wx prefix from wxPython objects by
    > dynamically loading and renaming objects from the real wxPython
    > package. This is the first phase of a transition to a new style
    > of using wxPython. For example:
    >
    > import wx
    > class MyFrame(wx.Frame):
    > ...
    >
    > instead of:
    >
    > from wxPython.wx import *
    > class MyFrame(wxFrame):
    > ...
    >
    > What does 'this is the first phase of a transition to a new style
    > using wxPython' in the above mean? Will this new style become the
    > only way to use wxPython in future releases?
    >
    > Thanks in advance for any answers.
    >
    > --
    > mailto: logan@phreaker(NoSpam).net
    >
    Mark Hahn, Nov 26, 2003
    #5
  6. Logan

    David Bolen Guest

    James Tanis <> writes:

    > Bah, I think they are just over-glorifying the change. In my
    > mind, it's the same exact thing. The only real different is when you
    > "from wxPython.wx import *" it reads everything into your local
    > namespace which is traditionally considered not the best thing to do.
    > I really have no idea if the "transition" when finished will remain
    > backwards compatible, but I'm guessing from the description of the
    > implementation that it is.


    To be honest, for a while now I've often been doing:

    from wxPython import wx

    and putting up with duplicated references to wx (e.g., wx.wxWindow).
    That avoids both the pollution of the local namespace and the overhead
    of pulling in the several thousand names (I got a noticeable
    performance speed up in an application with many plugins since each
    plugin no longer needed to make extra references for all the wx
    objects in the plugin's local namespace).

    One reason why I haven't moved to the new wx package yet is that it's
    implemented as a lazy evaluation approach (probably for performance),
    which means it doesn't play nice with interface tools that need
    introspection (e.g., IDE completion) which some of my other developers
    use. Once wx becomes a full fledged normal module I'd definitely
    consider moving to it for the same reasons that I use the above
    approach now.

    -- David
    David Bolen, Dec 11, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dlo_olb
    Replies:
    2
    Views:
    2,303
    Fredrik Lundh
    Jun 25, 2003
  2. ankit
    Replies:
    1
    Views:
    340
    Alex Martelli
    Dec 22, 2005
  3. Panos Laganakos
    Replies:
    2
    Views:
    293
    Alex Martelli
    May 3, 2006
  4. G Fernandes

    is this definition old-style or new-style

    G Fernandes, Feb 27, 2005, in forum: C Programming
    Replies:
    8
    Views:
    437
    Andrey Tarasevich
    Mar 1, 2005
  5. Ken Varn
    Replies:
    0
    Views:
    443
    Ken Varn
    Apr 26, 2004
Loading...

Share This Page