On 04/12/2011 08:34 AM, Tobias Hoppe wrote: > I've read the status page for py3k and stumbled upon the cleanup tasks, > especially the version checks. I agree that calling sys.version_info[0] is > not a > smart choice. > > Why not use a new variable in __init__.py, something like a boolean > __is_py3k__. > Every module which needs a choice between py2.x and 3.x can simply: > > from matplotlib import __is_py3k__ > > and use: > > if __is_py3k__: > > It can't live in __init__.py without creating cyclical imports. (__init__.py includes most everything else). I think the solution, though not ideal either, is to create a new module called "compat" or some such that contains this and possibly other python2/python3 compatibility code.
Cheers, Mike -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA ------------------------------------------------------------------------------ Forrester Wave Report - Recovery time is now measured in hours and minutes not days. Key insights are discussed in the 2010 Forrester Wave Report as part of an in-depth evaluation of disaster recovery service providers. Forrester found the best-in-class provider in terms of services and vision. Read this report now! http://p.sf.net/sfu/ibm-webcastpromo _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel