Robin Dunn <robin@alldunn.com> writes:
> Next question: If we move
> the wxEVT constants into a separate submodule, do we want to drop the
> wx prefix, or leave it on?
Which way would cause the least confusion? On the one hand there will
be some names (but not nearly all) that are the same between the two
modules, and on the other you would be leaving the wx prefix on the
names where you are removing them from everything else...
I don't feel too strongly either way. Here are some considerations.
Reasons to leave the wx prefix in place
···
=======================================
* We can only drop the prefix if we *do* move the constants to a
separate namespace. Even with a separate module (const, perhaps) in
place, doing the following would be disasterous if we dropped the
prefix:
from wx import *
from wx.const import *
* Folks who mess with these constants should know what they are doing,
and should be able to handle the "wx" prefix wart. (Sure, she's got
a big wart on her nose. But we've known each other since we were
babies. So be nice to her. She's like a sister to me.)
Reasons to drop the wx prefix
* If we don't do it now it will likely never happen.
* We're dropping them everywhere else, why not here? (Eventually the
__class__.__name__ attribute will catch up and there won't be a
prefix there either.)
* Moving them to a new namespace is going to require user code changes
anyway, so they might as well drop the prefix while they are at it.
* Introducing a new namespace (const?) is going to require more typing
then the old way. Dropping the prefix reduces the keystroke burden:
Before
------
from wxPython import wx
wx.wxEVT_CLOSE_WINDOW
After (with prefix)
-------------------
from wx import const
const.wxEVT_CLOSE_WINDOW
After (without prefix)
----------------------
from wx import const
const.EVT_CLOSE_WINDOW
* Anyone who does import * with the new packaging ought to suffer
(extensively, and for as long as possible).
That's all I could think of. I'm leaning toward dropping the prefix.
--
Patrick K. O'Brien
Orbtech http://www.orbtech.com/web/pobrien
-----------------------------------------------
"Your source for Python programming expertise."
-----------------------------------------------