FW: going from UpperUpper to lower Uppermeth od names

More good points. Is this reason enough to leave the event
binding function names alone?

I don't see much need to alter the binding function names drastically.
In some ways, I like the all-caps names, as they "stand out", and
hence highlight the places where event handlers are registered.

There's also the lib.evtmgr library, for a different form of event
handling.

With my current prototype we've got names like this:

   >>> import wx
   >>> wx.bind.left_dclick

Looking at this, I'm not keen on it.

If we have an opportunity to rename them, let's take advantage
of that and turn them into something everyone likes.

Agreed - to the extent that we don't *have* to rename unless people
really want it.

Lowercase is easy, so that's what I did. Moving them into their
own namespace eliminates the need for the EVT_ prefix, so that
was taken off as well.

It's certainly worth doing as an experiment, but having seen it (albeit
only in brief snippets) I don't like it.

We could easily leave the constant in the new wx module with the old
name ("wxEVT_LEFT_DCLICK"), rather than removing the "wx" prefix, to
eliminate that possible confusion. Thoughts? Opinions?

Keep it simple: wx.EVT_LEFT_DCLICK and wx.wxEVT_LEFT_DCLICK.

Reasons:

1. Easy to mentally translate to & from the C++ docs.
2. Less likely to be controversial because it's closer to the
   status quo.
3. Easier to automatically translate code using the old names
   to the new ones. (Especially if the translation is manual rather
   than by program).

Paul.

···

From: Patrick K. O'Brien [mailto:pobrien@orbtech.com]

"Moore, Paul" <Paul.Moore@atosorigin.com> writes:

I don't see much need to alter the binding function names drastically.
In some ways, I like the all-caps names, as they "stand out", and
hence highlight the places where event handlers are registered.

And the current plan is to leave them unchanged.

> With my current prototype we've got names like this:

> >>> import wx
> >>> wx.bind.left_dclick

Looking at this, I'm not keen on it.

Me either. It sounded good at the time, but the results are less than
spectacular. The one benefit we do miss out on is easier
introspection, by having all the binding functions in their own
namespace.

> If we have an opportunity to rename them, let's take advantage
> of that and turn them into something everyone likes.

Agreed - to the extent that we don't *have* to rename unless people
really want it.

And the reasons to not rename them outway anything else at this point.

> Lowercase is easy, so that's what I did. Moving them into their
> own namespace eliminates the need for the EVT_ prefix, so that
> was taken off as well.

It's certainly worth doing as an experiment, but having seen it (albeit
only in brief snippets) I don't like it.

Agreed.

> We could easily leave the constant in the new wx module with the old
> name ("wxEVT_LEFT_DCLICK"), rather than removing the "wx" prefix, to
> eliminate that possible confusion. Thoughts? Opinions?

Keep it simple: wx.EVT_LEFT_DCLICK and wx.wxEVT_LEFT_DCLICK.

Reasons:

1. Easy to mentally translate to & from the C++ docs.
2. Less likely to be controversial because it's closer to the
   status quo.
3. Easier to automatically translate code using the old names
   to the new ones. (Especially if the translation is manual rather
   than by program).

That's where we are now, with the possibility that the wxEVT constants
might move into a separate namespace. So anyone who was in favor of
changing event binding names needs to make a case for any
change. Otherwise they will not be changed.

···

--
Patrick K. O'Brien
Orbtech http://www.orbtech.com/web/pobrien
-----------------------------------------------
"Your source for Python programming expertise."
-----------------------------------------------