Re: wx.lib.six is deepsixed

Dietmar Schwertberger <[email protected]>
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>
Most of my code was or is 2/3 neutral.
Besides the __future__ imports, I mainly had to take care for str/unicode.
IIRC, the effort for being compatible to Classic and Phoenix was more 
effort than 2/3.

So, for some programs/modules I have a header like this:

from __future__ import print_function, absolute_import, unicode_literals

try:
     basestring
     _PYTHON2 = True
except: # Python 3
     basestring = (bytes,str)
     unicode = str
     _PYTHON2 = False


Personally, I prefer to have such a header over an additional dependency 
and also "explicit is better than implicit".
On many occasions I used the basestring/unicode just because I did the 
port to Phoenix in one evening. When I have a closer look later, I often 
find that I just can use str instead due to __future__ unicode_literals.
For wxPython of course we can't rely on all strings being unicode.

Regards,

Dietmar


On 01.07.2016 18:59, Chris Barker wrote:
> Fine idea.
>
> I'm going to add, however, that I have found very little need for six 
> in writting pyton2/3 compatible code these days. So before you use it, 
> ask yourself if you really need to....
>
> This is a nice overview:
>
> https://docs.python.org/3/howto/pyporting.html
>
> And I wonder if we should consider using python-future:
>
> http://python-future.org/overview.html
>
> Anyone have experience with that?
>
> -CHB
>
>
> On Thu, Jun 30, 2016 at 9:43 PM, Robin Dunn <[email protected] 
> <mailto:[email protected]>> wrote:
>
>
>     Hi all,
>
>     Just a heads up that I'm removing the wx.lib.six module, and have
>     added an installation requirement on the real six module.  The
>     reasons that prompted adding it into wx.lib are all pretty much
>     gone, and I don't mind adding dependencies for Phoenix since that
>     is well managed by pip and wheels now. So feel free to use the six
>     module in your library modules or whatever.
>
>     The change is done including updating all the existing uses of
>     six.  It will get pushed later this evening once a few other
>     things are done.
>
>
>     -- 
>     Robin Dunn
>     Software Craftsman
>     http://wxPython.org
>
>     -- 
>     You received this message because you are subscribed to the Google
>     Groups "wxPython-dev" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     send an email to [email protected]
>     <mailto:wxPython-dev%[email protected]>.
>     For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> -- 
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> [email protected] <mailto:[email protected]>
> -- 
> You received this message because you are subscribed to the Google 
> Groups "wxPython-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.