On Mon, Feb 8, 2016 at 8:44 AM, <c...@isbd.net> wrote: > I'm playing with some code that uses the wxpython grid. *Every* > example I have seen starts with the imports:- > > import wx > import wx.grid as Gridlib > > As Gridlib is exactly the same number of characters as wx.grid I > really don't see the point. Am I missing something?
You're not missing anything. I've actually never seen that before (or at least never noticed). The first hit when searching "import wx.grid" is http://wxpython.org/Phoenix/docs/html/grid_overview.html which doesn't use the "as" (but I see some hits farther down that do). Probably the author of that code was just trying to save a dict lookup every time "wx.grid" is referenced (which has to look up "wx" in the globals and then "grid" as an attribute). Seems like an unnecessary micro-optimization to me. -- https://mail.python.org/mailman/listinfo/python-list